O'Reilly logo

Expert Data Visualization by Jos Dirksen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Converting the data to TopoJSON

When visualizing data there are two formats we can use with D3: GeoJSON and TopoJSON. Both of these formats can be used to encode geographic data structures containing Points, LineStrings, Polygons, MultiPoints and MultiLineStrings as a JSON file. GeoJSON (http://geojson.org/) is the de facto standard for encoding data in JSON, and TopoJSON is an extension of GeoJSON, which tries to eliminate redundancy and create smaller files and speed up processing. TopoJSON (https://github.com/topojson/topojson) was created by Mike Bostock, the man behind D3. In this section, we'll convert the shapefile we explored in the previous section to a TopoJSON file which we can read in D3.

TopoJSON isn't just a data format, it ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required