New geocoding engine delivers results up to 24 times faster

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:

http://geocoding.cloudmade.com/YOUR-API-KEY/geocoding/v2/find.output_type?query=search_query&parameters

Examples

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
http://geocoding.cloudmade.com/BC9A493B41014CAABB98F0471D759707/geocoding/v2/find.js?query=Fleet+street,+London,+UK
http://geocoding.cloudmade.com/BC9A493B41014CAABB98F0471D759707/geocoding/v2/find.html?query=Fleet+street,+London,+UK

Searching for a street or road whose name contains « temple »
http://geocoding.cloudmade.com/BC9A493B41014CAABB98F0471D759707/geocoding/v2/find.js?object_type=road&around=51.51384,-0.10952&distance=closest&query=temple
http://geocoding.cloudmade.com/BC9A493B41014CAABB98F0471D759707/geocoding/v2/find.html?object_type=road&around=51.51384,-0.10952&distance=closest&query=temple

Searching for all hotels around a point
http://geocoding.cloudmade.com/BC9A493B41014CAABB98F0471D759707/geocoding/v2/find.js?object_type=hotel&around=51.51384,-0.10952&distance=2000&results=10
http://geocoding.cloudmade.com/BC9A493B41014CAABB98F0471D759707/geocoding/v2/find.html?object_type=hotel&around=51.51384,-0.10952&distance=2000&results=10

Reverse geocoding
http://geocoding.cloudmade.com/BC9A493B41014CAABB98F0471D759707/geocoding/v2/find.js?around=51.51384,-0.10952&distance=closest&object_type=address
http://geocoding.cloudmade.com/BC9A493B41014CAABB98F0471D759707/geocoding/v2/find.html?around=51.51384,-0.10952&distance=closest&object_type=address

Query

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.

Parameters

Parameter Explanation Default
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

Output type can either be « .js » for JSON, « .geojs » for GeoJSON or « .html » to render search results on the map (useful for debug purposes).

Cet article a été publié dans Uncategorized. Ajoutez ce permalien à vos favoris.

Laisser un commentaire

Entrez vos coordonnées ci-dessous ou cliquez sur une icône pour vous connecter:

Logo WordPress.com

Vous commentez à l'aide de votre compte WordPress.com. Déconnexion / Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion / Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion / Changer )

Photo Google+

Vous commentez à l'aide de votre compte Google+. Déconnexion / Changer )

Connexion à %s