문제

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