How to run TopoJSON?

user1781186 picture user1781186 · May 18, 2013 · Viewed 11.3k times · Source

I need to convert a geojson file to topojson and possibly simplify the topojson file. I've managed to install Node.js and the topojson package. But I have no idea how to run topojson.

The wiki lists a bunch of command line options, but where do I run those commands? I've tried running them both in the command prompt and the node shell. Node, GDAL, ogr2ogr and TopoJSON are all new concepts for me, so I'm a bit confused and overwhelmed.

I'm running on Windows by the way.

Answer

Nitin picture Nitin · Nov 22, 2016

topojson executable is now changed to geo2topo

  • Installation steps remain the same, just like topojson
  • To create a topo json file from geo json file, geo2topo -o topo-output.json geo-input.json

One way to obtain geo-input.json is from gdal which takes a shape file as input and outputs geojson. gdal can be installed via home brew using brew install gdal