Skip to content
Snippets Groups Projects
Select Git revision
  • 49f73728685343243cf74dd346acfdb0a6865fa9
  • master default protected
  • rails-geocoder
  • rails2
  • v1.5.1
  • v1.5.0
  • v1.4.9
  • v1.4.8
  • v1.4.7
  • v1.4.6
  • v1.4.5
  • remove
  • v1.4.4
  • v1.4.3
  • v1.4.2
  • v1.4.1
  • v1.4.0
  • v1.3.7
  • v1.3.6
  • v1.3.5
  • v1.3.4
  • v1.3.3
  • v1.3.2
  • v1.3.1
24 results

README.md

Blame
  • README.md 34.12 KiB

    Geocoder

    A complete geocoding solution for Ruby.

    Gem Version Code Climate Build Status GitHub Issues License

    Key features:

    • Forward and reverse geocoding, and IP address geocoding.
    • Connects to more than 40 APIs worldwide.
    • Performance-enhancing feaures like caching.
    • Advanced configuration allows different parameters and APIs to be used in different conditions.
    • Integrates with ActiveRecord and Mongoid.
    • Basic geospatial queries: search within radius (or rectangle, or ring).

    Compatibility:

    • Supports multiple Ruby versions: Ruby 1.9.3, 2.x, and JRuby.
    • Supports multiple databases: MySQL, PostgreSQL, SQLite, and MongoDB (1.7.0 and higher).
    • Supports Rails 3, 4, and 5. If you need to use it with Rails 2 please see the rails2 branch (no longer maintained, limited feature set).
    • Works very well outside of Rails, you just need to install either the json (for MRI) or json_pure (for JRuby) gem.

    Table of Contents

    Basic Features:

    Advanced Features:

    The Rest:

    See Also:

    Basic Search

    In its simplest form, Geocoder takes an address and searches for its latitude/longitude coordinates:

    results = Geocoder.search("Paris")
    results.first.coordinates
    => [48.856614, 2.3522219]  # latitude and longitude

    The reverse is possible too. Given coordinates, it finds an address: