Reputation: 18248
Topojson-svg trial: I gave it a shoot...
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 uk.json
=> output.svg
result is a #000000FF
version of this :
which is UK, right, but with strange circles and inverted uk.
Upvotes: 4
Views: 1219
Reputation: 18248
Based on Jason davies' answer.
The problem is that you’re converting unprojected TopoJSON (geographic coordinates) to SVG.
You need the lastest topojson
code :
sudo npm rm -g topojson
sudo npm install -g topojson
topojson --version
Should return +1.6.12.
You’ll want to pre-project uk.json first, using topojson. Then, convert the projected TopoJSON to SVG using 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 !
Produce that :
The uk.topojson
containing 2 layers merged from 2 different topoJSON
, large circles are causes by the object-places
layer. But the country shapes are doing well.
Upvotes: 3