Friday, July 20, 2018

Difference between GeoJSON and TopoJSON

In the Geospatial industry, data handling and conversion is a vital skill especially when data are been moved from on platform to another.

Some data formats work better on one platform than another. For example, data in shapefile format are more flexible on desktop apps than on web apps. If you are looking for an excellent data format to use on the web, then "GeoJSON and TopoJSON" data formats are your best option. But what is the difference between "GeoJSON and TopoJSON"?

In this post, I will attempt to differentiate the two powerful web based geospatial data formats (GeoJSON and TopoJSON).

GeoJSON is an open standard format designed for representing simple geographical features, along with their non-spatial attributes. Both GeoJSON and TopoJSON are based on JSON, the JavaScript Object Notation.

As extracts from Noah Veltman of and Mike Bostock (and other contributors to the TopoJSON extension) repectively:-

GeoJSON and TopoJSON are two web-friendly file formats for geographic data.
A GeoJSON file is a text file with a list of features and, for each one, a bunch of latitudes and longitudes describing its geometry.
A TopoJSON file is similar, but instead of storing the latitudes and longitudes directly, it describes the topology (geometrical properties and spatial relations of figures) of a group of features, meaning the borders between them. TopoJSON files are usually much smaller, but require a little bit of extra processing in the browser when you want to display one on a map, and can potentially lose details from the original latitudes/longitudes.

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.

The advantage of TopoJSON over GeoJSON is size and encoding of topology. So, if the file size or topology of feature is paramount to you, use TopoJSON instead of GeoJSON.

No comments:

Post a Comment