While no one was watching, we deployed the latest version of our geocoding engine. The key objective for this release has been performance and stability, and I am sure it is immediately noticeable. Benchmarking based on actual user queries have shown that it is up to 24 times faster than the previous implementation for certain classes of requests. Even for simple, one-word queries, it is up to three times faster.
Along with the new engine, we are introducing new Geocoding API V2. In an effort to simplify usage, we have reduced the number of methods from eleven to only one, without sacrificing a single bit of its flexibility. Take a look here to read about the new (easy) query syntax. The old API? It, too, uses the new engine to deliver faster results, but we do encourage everyone to switch to the new API as soon as you have a chance to.
In the meantime, we are already working on the next release. The main focus will be relevancy and better parsing of freeform queries. Stay tuned!
October 8th, 2009 – Posted by Sergiy Drapiko
The geocoding API exposes a single method find which can be invoked by the following URL:
Please note that geocoding API expects UTF-8 encoding. Most browsers (except Chrome) do not encode query params as UTF-8, so you will need to adjust their settings if you want to test names that contain characters such as å, ü, Cyrillic characters etc. In Firefox, this is done by opening about:config URL and setting network.standard-url.encode-query-utf8 = true
Geocoding an address
Searching for a street or road whose name contains « temple »
Searching for all hotels around a point
search_query, if present, specifies an address to geocode, or a keyword used to search for objects whose name contains the keyword.
If the query represents an address, it can either be in free form format (for example, query=Oxford+st,+London,+UK), or specified as a set of address parts separated by semicolon. The following address parts are recognized: poi, house, street, city, zipcode or postcode, county, country. For example, query=street:Oxford street;city:London;country:UK.
For queries representing a keyword, search is case-insensitive, matching whole words. Wildcards are not currently supported.
|results||Number of results to return.||10|
|skip||Number of results to skip from beginning.||0|
|return_geometry||Set it to false if you do not want to have geometry in returned results.||true|
|return_location||Set it to true if you do want location information like road, city, county, country, postcode in returned results.||false|
|bbox||Bounding box of the search area. Format: « southern_latitude,western_longitude,northern_latitude,eastern_longitude ». Cannot be used together with around or distance|
|around and distance||Center point and radius of the search area. around must be an EPSG:4326 coordinate (« latitude,longitude ») or an address. Distance is specified in meters from the center point. Special value closest limits search results to one, closest to the center point of the search area. Default value for distance is 100 meters. Cannot be used together with bbox. If used together with a non-empty search_query, only one may specify an address.|
|bbox_only||Used only if bbox is specified. If set to false, the geocoder will return results from the whole planet, but still ranking results from within the specified bbox higher, otherwise only results from within the specified bbox will be returned.||true|
|object_type||Limits search results for a specific object type. Full list of object types can be found here.||If around / distance is specified, the default is address.|
Output type can either be « .js » for JSON, « .geojs » for GeoJSON or « .html » to render search results on the map (useful for debug purposes).