Class: Graticule::Geocoder::MetaCarta
- Defined in:
- lib/graticule/geocoder/meta_carta.rb
Overview
Library for looking up coordinates with MetaCarta’s GeoParser API.
Constant Summary
Constants inherited from Base
Instance Method Summary collapse
-
#initialize ⇒ MetaCarta
constructor
:nodoc:.
-
#locate(location) ⇒ Object
Finds
location
and returns a Location object.
Constructor Details
#initialize ⇒ MetaCarta
:nodoc:
10 11 12 |
# File 'lib/graticule/geocoder/meta_carta.rb', line 10 def initialize # :nodoc: @url = URI.parse 'http://labs.metacarta.com/GeoParser/' end |
Instance Method Details
#locate(location) ⇒ Object
Finds location
and returns a Location object.
15 16 17 |
# File 'lib/graticule/geocoder/meta_carta.rb', line 15 def locate(location) get :q => location.is_a?(String) ? location : location_from_params(location).to_s, :output => 'locations' end |