Skip to content

andycox/topojson-rails

Repository files navigation

topojson-rails

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.

Installation

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

HighSecurity

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

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

Gemified topojson.js asset for Rails

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published