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.
Want to learn more? See the wiki.
Add the following to your gemfile:
gem 'topojson-rails'
And then execute:
$ bundle
Add the following directive to your JavaScript manifest file (application.js):
//= require topojson
To ensure that you're including a gem with original code, you can install this gem using a HighSecurity policy.
gem cert --add <(curl -Ls https://gist.github.com/bai/5150087/raw/public_cert.pem)
bundle install --trust-policy HighSecurity
Or, if you don't use bundler:
gem install topojson-rails -P HighSecurity
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request