Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Question

How do you convert GeoJSON data to TopoJSON?

Why

Most likely, because you want a smaller file size. From the TopoJSON docs:

TopoJSON eliminates redundancy, allowing related geometries to be stored efficiently in the same file.... As a result, TopoJSON is substantially more compact than GeoJSON. The above shapefile of U.S. counties is 2.2M as a GeoJSON file, but only 436K as a boundary mesh, a reduction of 80.4% even without simplification.

Also, TopoJSON allows you to incrementally simplify a dataset, if you wish to.

share|improve this question
Why the gdal tag? – blah238 Jan 3 at 18:28
Gosh, good question. Not sure what I was thinking on that one :) Removed. – Jeff Jan 3 at 20:53

1 Answer

up vote 9 down vote accepted

Glad you asked, oh handsome OP.

Steps

For Mac OSX 10.8, assumes the installation of homebrew.

  1. Install node.js: brew install node.js
  2. Install topojson under node: npm install -g topojson
  3. Convert the data: topojson -o output_file.json input_file.json
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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