Project

latlong

0.0
No commit activity in last 3 years
No release in over 3 years
Finds coordinates by address
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
>= 0
~> 10.0
>= 0
>= 0

Runtime

 Project Readme

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