36

Question

How do you convert GeoJSON data to TopoJSON?

Why

Topojson files are often smaller than geojson and the conversion allows you to incrementally simplify a dataset, if you wish.

  • Step 3: Convert the data: topojson -o output_file.json input_file.json not working!!!!!!!!!!!! – user21773 Sep 6 '13 at 17:00
  • 1
    topojson -o output_file.json input_file.json works for me under 1.1.0 and 1.4.0. Perhaps you can ask a formal question on here with more info on the problem you're having? Cheers! – Jeff Sep 6 '13 at 18:09
26

Glad you asked, oh handsome OP.

Install topojson

From the command line (Mac OSX 10.8, assumes homebrew installed):

brew install node.js
npm install -g topojson

Convert The Data

topojson -o output.json input.json
4

The function to create a topojson from a geojson in topojson has been moved to geo2topo

npm install topojson-server
geo2topo input.geojson > output.topojson

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.