README.md in geocoder-1.1.4 vs README.md in geocoder-1.1.5

- old
+ new

@@ -261,11 +261,11 @@ # config/initializers/geocoder.rb Geocoder.configure do |config| # geocoding service (see below for supported options): - config.lookup = :yahoo + config.lookup = :yandex # to use an API key: config.api_key = "..." # geocoding service request timeout, in seconds (default 3): @@ -302,21 +302,23 @@ * **Documentation**: http://code.google.com/apis/maps/documentation/geocoding/#JSON * **Terms of Service**: http://code.google.com/apis/maps/terms.html#section_10_12 * **Limitations**: "You must not use or display the Content without a corresponding Google map, unless you are explicitly permitted to do so in the Maps APIs Documentation, or through written permission from Google." "You must not pre-fetch, cache, or store any Content, except that you may store: (i) limited amounts of Content for the purpose of improving the performance of your Maps API Implementation..." * **Notes**: To use Google Premier set `Geocoder::Configuration.lookup = :google_premier` and `Geocoder::Configuration.api_key = [key, client, channel]`. -#### Yahoo (`:yahoo`) +#### Yahoo BOSS (`:yahoo`) -* **API key**: optional in development (required for production apps) -* **Key signup**: https://developer.apps.yahoo.com/wsregapp -* **Quota**: 50,000 requests/day, more available by special arrangement +Yahoo BOSS is **not a free service**. As of November 17, 2012 Yahoo no longer offers a free geocoding API. + +* **API key**: requires OAuth consumer key and secret (set `Geocoder::Configuration.api_key = [key, secret]`) +* **Key signup**: http://developer.yahoo.com/boss/geo/ +* **Quota**: unlimited, but subject to usage fees * **Region**: world * **SSL support**: no -* **Languages**: ? -* **Documentation**: http://developer.yahoo.com/geo/placefinder/guide/responses.html -* **Terms of Service**: http://info.yahoo.com/legal/us/yahoo/maps/mapsapi/mapsapi-2141.html -* **Limitations**: "YOU SHALL NOT... (viii) store or allow end users to store map imagery, map data or geocoded location information from the Yahoo! Maps APIs for any future use; (ix) use the stand-alone geocoder for any use other than displaying Yahoo! Maps or displaying points on Yahoo! Maps;" +* **Languages**: en, fr, de, it, es, pt, nl, zh, ja, ko +* **Documentation**: http://developer.yahoo.com/boss/geo/docs/index.html +* **Terms of Service**: http://info.yahoo.com/legal/us/yahoo/boss/tou/?pir=ucJPcJ1ibUn.h.d.lVmlcbcEkoHjwJ_PvxG9SLK9VIbIQAw1XFrnDqY- +* **Limitations**: No mass downloads, no commercial map production based on the data, no storage of data except for caching. #### Bing (`:bing`) * **API key**: required * **Key signup**: http://www.bingmapsportal.com @@ -361,12 +363,15 @@ * **Terms of Service**: http://geocoder.ca/?terms=1 * **Limitations**: "Under no circumstances can our data be re-distributed or re-sold by anyone to other parties without our written permission." #### Mapquest (`:mapquest`) -* **API key**: none +* **API key**: required for the licensed API, do not use for open tier * **Quota**: ? +* **HTTP Headers**: in order to use the licensed API you can configure the http_headers to include a referer as so: + `Geocoder::Configuration.http_headers = { "Referer" => "http://foo.com" }` + You can also allow a blank referer from the API management console via mapquest but it is potentially a security risk that someone else could use your API key from another domain. * **Region**: world * **SSL support**: no * **Languages**: English * **Documentation**: http://www.mapquestapi.com/geocoding/ * **Terms of Service**: http://info.mapquest.com/terms-of-use/ @@ -521,9 +526,18 @@ Calling `obj.coordinates` directly returns the internal representation of the coordinates which, in the case of MongoDB, is probably the reverse of what you want: obj.coordinates # => [-122.3951096, 37.7941013] # [lon, lat] For consistency with the rest of Geocoder, always use the `to_coordinates` method instead. + +Optimisation of Distance Queries +-------------------------------- + +In MySQL and Postgres the finding of objects near a given point is speeded up by using a bounding box to limit the number of points over which a full distance calculation needs to be done. + +To take advantage of this optimisation you need to add a composite index on latitude and longitude. In your Rails migration: + + add_index :table, [:latitude, :longitude] Distance Queries in SQLite --------------------------