简体   繁体   中英

iOS: ReverseGeocoding Using CLGeocoder Vs. Google Geocoder API

I am building an iOS application that in one of its functions implements reverse geocoding for obtaining street addresses from user gesture tap on a map.

When running the app using CLGeocoder's reverse geocoding features, I was only able to get the city and country details. In some cases in main roads I was able to get the main road name.

I thought that this limitation is from the Google Maps api.

But when I tested this example, (http://gmaps-samples.googlecode.com/svn/trunk/geocoder/reverse.html) I was able to get much more accurate and detailed information such as street number and name and zip code.

Is this a limitation of CLGeocoder? if so, how can I implement the Google Maps api on my app?

It's my understanding that CLGeocoder has not used Google for data for around the last year; When it did use Google there was a substantial limitation on number of users per day.

You may also want to try the same CLGeocoder call in an iOS6 simulator to see if you get more data.

You could use the Google API calling directly from your app, but be carful to read the TOS for limitations in regards to users.

Well, it would appear that yes, Apple's CLGeocoder is nothing like as accurate for forward geocoding (address -> coordinates) as the Google Maps Geocoding API, particularly outside of the USA. Using an Address Dictionary with all the fields filled out as fully as possible works a lot better than a simple address string, but it's still no where near good enough. Where Google will (usually) give you coordinates within 5-10m of the street number, Apple will give you coordinates somewhere in the right street, if you're lucky.

Found Apple Developer Technical Note TN2289 which details Supported Countries for CLGeocoder .

Further iOS6 would stop the support to use of Google Maps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM