简体   繁体   English

iOS:使用CLGeocoder Vs进行反向地理编码 Google Geocoder API

[英]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. 我正在构建一个iOS应用程序,该应用程序在其一个功能中实现反向地理编码,以便从地图上的用户手势点击获取街道地址。

When running the app using CLGeocoder's reverse geocoding features, I was only able to get the city and country details. 使用CLGeocoder的反向地理编码功能运行应用程序时,我只能获取城市和国家/地区的详细信息。 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. 我认为这个限制来自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. 但是,当我测试这个例子时,(http://gmaps-samples.googlecode.com/svn/trunk/geocoder/reverse.html)我能够获得更准确和详细的信息,例如街道号码,姓名和邮政编码。

Is this a limitation of CLGeocoder? 这是CLGeocoder的限制吗? if so, how can I implement the Google Maps api on my app? 如果是这样,我如何在我的应用上实施Google Maps api?

It's my understanding that CLGeocoder has not used Google for data for around the last year; 据我所知,CLGeocoder去年没有使用Google获取数据; 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. 您可能还想在iOS6模拟器中尝试相同的CLGeocoder调用,以查看是否获得了更多数据。

You could use the Google API calling directly from your app, but be carful to read the TOS for limitations in regards to users. 您可以直接从您的应用中使用Google API调用,但请务必阅读TOS以了解用户的限制。

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. 好吧,似乎是的,Apple的CLGeocoder与Google Maps Geocoding API(特别是在美国以外)的前向地理编码(地址 - >坐标)一样准确。 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. 谷歌将(通常)在街道号码的5-10米范围内为您提供坐标,如果您幸运的话,Apple会在右侧街道的某个地方为您提供坐标。

Found Apple Developer Technical Note TN2289 which details Supported Countries for CLGeocoder . 找到Apple Developer Technical Note TN2289 ,其中详细介绍了CLGeocoder支持的国家/ CLGeocoder

Further iOS6 would stop the support to use of Google Maps 此外,iOS6将停止支持使用Google地图

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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