Question

I have an ESRI shapefile in WGS84 and convert it to another with a European Albers projection (EPSG:102013) with ogr2ogr.

ogr2ogr -f 'ESRI Shapefile' -t_srs 'EPSG:102013' europe.shp europe_data_wgs84.shp

I then convert it to TopoJSON using the following:

topojson --id-property iso_a3 -o europe.json -p --simplify-proportion 0.25 --width 900 --height 600 -- countries=europe.shp

I then load europe.json via D3 and can successfully display it (by setting the projection to null as it is already projected).

enter image description here

Each country of Europe has a class .country.

This is what happens when I set .country { fill: rgb(200,200,200); }:

enter image description here

So somehow, the paths are not displayed correctly? I don't understand as the paths seem to render normally without a custom fill. What am I doing wrong?

Was it helpful?

Solution

Already found the problem. I had a topojson.mesh layer with class .country-boundaries above the country layer, and this mesh had still a fill color defined. So I had to set

.country-boundaries { fill: none; }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top