Topojson-svg topojson to svg output is in reverse order

Topojson-svg test: I gave him a shot ...

curl -o uk.topo.json 'http://bost.ocks.org/mike/map/uk.json' #get an online topoJSON file
topojson-svg -o output.svg uk.topo.json    #works !

But the result uk.json=> output.svgis a #000000FFversion of this:

wikiatlas_topojson-svg

which is the UK, on ​​the right, but with weird circles and inverted uk.

+4
source share
1 answer

Based on Jason davies answer .

The problem is that you are converting non-projected TopoJSON (geographic coordinates) to SVG.

You need the last topojsoncode:

 sudo npm rm -g topojson
 sudo npm install -g topojson
 topojson --version

Should be returned +1.6.12.

uk.json, topojson. TopoJSON SVG topojson-svg.

curl -o uk.topo.json 'http://bost.ocks.org/mike/map/uk.json' #get an online topoJSON file
topojson uk.topo.json --projection='d3.geo.mercator()' -o out.topo.json #works !
topojson-svg -o output.svg out.topo.json    #works !

:

wikiatlas_topojson-svg_reprojected_subunits labels

uk.topojson, 2 , 2 topojson, object-places. .

+3

Source: https://habr.com/ru/post/1539962/


All Articles