This is a conceptual question.

What are the differences between these? and what are the pros and cons of these formats?

up vote 18 down vote accepted

According to Mike Bostock (and other contributors to the TopoJSON extension):

TopoJSON is an extension of GeoJSON that encodes topology. Rather than representing geometries discretely, geometries in TopoJSON files are stitched together from shared line segments called arcs. TopoJSON eliminates redundancy, offering much more compact representations of geometry than with GeoJSON; typical TopoJSON files are 80% smaller than their GeoJSON equivalents. In addition, TopoJSON facilitates applications that use topology, such as topology-preserving shape simplification, automatic map coloring, and cartograms.

One possible disadvantage of TopoJSON is that you need to implement support for converting the TopoJSON back into GeoJSON, for libraries that only work with GeoJSON.

  • 3
    This is correct. The coordinate data in TopoJSON also becomes somewhat opaque by the nature of the translate/scale constants and statefulness of each coordinate pair since they are all relative to their preceding points in the line string, making it harder to read. – Jason Scheirer Aug 22 '13 at 17:58
  • 2
    re: support - It looks like the community is starting to add topojson support, presumably because of the 'weight' of geojson over a small pipe. PostGIS2.1 (Aug 2013 release) support a From_TopoJson and the topojson team has a reader that integrates with D3. Support from these two larger players is, I believe, a great thing for keeping TopoJson around. – Jay Laura Aug 22 '13 at 18:08
  • 1
    This is a good explanation of toposjson. – neogeomat Sep 5 '13 at 11:52

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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