TopoJSON with strange paths

拥有回忆 提交于 2019-12-01 10:57:00

问题


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).

Each country of Europe has a class .country.

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

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?


回答1:


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; }


来源:https://stackoverflow.com/questions/22939533/topojson-with-strange-paths

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!