I'm coding an application that needs to geocode the centroid of ZIP codes. I'm using Cloudmade's geocoding API, but can't figure out what the country code for the United States is. All of their examples use Germany (http://cloudmade.com/documentation/geocoding).

I've tried all of the following, but the returned JSON says the search failed.

http://beta.geocoding.cloudmade.com/v3/{API KEY}/api/geo.location.search.2?format=json&source=OSM&enc=UTF-8&limit=1&q=[country=us][zip=44130]

http://beta.geocoding.cloudmade.com/v3/{API KEY}/api/geo.location.search.2?format=json&source=OSM&enc=UTF-8&limit=1&q=[country=usa][zip=44130]

http://beta.geocoding.cloudmade.com/v3/{API KEY}/api/geo.location.search.2?format=json&source=OSM&enc=UTF-8&limit=1&q=[country=unitedstates][zip=44130]

I can't use ZIP code alone, because often the results return something with a similar postal code from another country (Ukraine, for example). Does anyone know how to restrict such a search to the United States?

有帮助吗?

解决方案 2

If you want to geocode places in USA, please use the geocoding API v2:

http://cloudmade.com/misc/geocoding_v2.pdf

其他提示

Cloudmade no longer offers a free geocoding/routing api...you must be a paying enterprise customer.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top