iOS:使用CLGeocoder与ReverseGeocoding进行比较Google Geocoder API [英] iOS: ReverseGeocoding Using CLGeocoder Vs. Google Geocoder API
问题描述
我正在构建一个iOS应用程序,该应用程序的一个功能实现了反向地理编码,可通过地图上的用户手势获取街道地址。
运行应用程序时CLGeocoder的反向地理编码功能,我只能得到城市和国家的详细信息。在主要道路的某些情况下,我能够获得主要道路名称。
我认为这个限制来自Google Maps api。
但是当我测试这个例子时,(http://gmaps-samples.googlecode.com/svn/trunk/geocoder/reverse.html)我能够得到更准确和详细的信息,如街道号码和名称以及邮政编码。
这是CLGeocoder的限制吗?如果是这样,我该如何在我的应用程序中实现Google Maps API?
那么,看起来是的,苹果公司的 CLGeocoder
与Google Maps Geocoding API(特别是美国以外)的前向地理编码(地址 - >坐标)完全不同。使用地址字典尽可能完整地填写所有字段的工作比简单的地址字符串好得多,但它仍然没有足够好的地方。如果你的运气好的话,谷歌会在5到10米的范围内给你坐标,如果你幸运的话,苹果公司会给你在右边街道上的坐标。 找到苹果开发人员技术说明TN2289 ,其中详细介绍了支持国家 CLGeocoder
。 进一步的iOS6将停止使用Google地图的支持
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?
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
这篇关于iOS:使用CLGeocoder与ReverseGeocoding进行比较Google Geocoder API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!