Skip to content

r-ideas/latlong

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

License

Stars

Watchers

Forks

Packages

No packages published

Languages