Optimizing geographic data files with TopoJSON
The topojson is a command-line utility used to create files in the TopoJSON-serialized format. The TopoJSON format will be discussed in detail in Chapter 6, Finding and Working with Geographic Data. The topojson utility is also installed via npm.
Note
Note that we will use the syntax TopoJSON to refer to the JSON format and topojson to indicate the command-line utility.
We already have installed Node.JS and npm, so enter the following on the command line:
npm install -g topojson
Once the installation is complete, you should check the version of topojson installed on your machine just as we did with Node.js:
topojson –version
If you see Version 1.x, it means you have successfully installed topojson.
Tip
topojson uses node-gyp that has several dependencies based on the operating system. Please go to http://github.com/TooTallNate/node-gyp for details.
If you're using Windows, the basic steps are as follows:
- Install Python 2.x (3.x not supported at the time of writing this book)
- Install Microsoft Visual Studio C++ 2012 for Desktop (Express)