Skip to content
r-ideasPublic

About

Find coordinates for address

Resources

Stars

0 stars

Watchers

2 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Latlong

Finds latitude and longitude for given address

Gem Version Build Status Code Climate Test Coverage Dependency Status

Installation

Add this line to your application's Gemfile:

gem 'latlong'

And then execute:

$ bundle

Or install it yourself as:

$ gem install latlong

Usage

In order to fetch coordinates for address, do this:

require 'latlong'

Latlong.configure do |config|
  config.provider = :yandex # or :google by default
end

results = Latlong.location 'Sacramento' # returns array of items with
                                        # coordinates and address

results.first.address   # 'Sacramento, US'
results.first.lat       # 38.5815719
results.first.lon       # -121.4943996

Also possible to enable caching for requests through redis:

require 'latlong'
require 'redis'

Latlong.configure do |config|
  config.provider = :yandex # or :google by default
  config.cache    = true
end

Contributing

  1. Fork it ( https://github.com/r-ideas/latlong/fork )
  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 a new Pull Request

About

Find coordinates for address

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages