iPhone反向地理编码:给出所有可能的街道/郊区?
我知道 iPhone 上的 Core Location 并不总是准确的。有没有办法使用位置(纬度/经度)以及准确性来获取该区域所有可能的郊区/街道?
因此,不是使用反向地理编码并让它猜测“最佳可能的郊区/街道”,有没有办法让它给出它可以考虑的所有可能的郊区/街道的数组(或以某种其他格式)?
谢谢!!
I know Core Location isnt always accurate on the iPhone. Is there a way to use the location (lat/long) along with the accuracy to then grab all of the possible suburbs/streets in that area?
So instead of using the reverse geocoding and having it guess the 'best possible suburb/street, is there a way to make it give an array (or in some other format) of all the possible suburbs/streets that it could consider?
Thanks!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,最好的方法是使用 Google 地图 API。例如,查看以下网址:http ://maps.google.com/maps/geo?q=38.4417077,-90.7122047&output=xml
如您所见,对于这一对(纬度、经度),您有 10 个可能的该坐标地标。
您可以在以下位置找到相关文档:http://code.google .com/apis/maps/documentation/geocoding/index.html
您可以看到您获取了 XML、JSON、CSV 格式的信息。
看一下状态码,验证请求是否成功很重要(通常是 200 或 200 之类的)。
那么,如何使用VFN呢?
这很简单。
on locationString 是 Google Geocoder 的响应,现在您可以根据需要使用该信息。请记住首先检查状态代码,然后解析信息。如果您只想要 Google Geocoder 选择的第一个地标,我建议您使用 CSV 格式的输出,这样很容易使用。
如果您有任何疑问,请告诉我!
干杯,
虚拟网络
So, the best approach to do this, is using the Google maps API. For example, take a look ate the following url: http://maps.google.com/maps/geo?q=38.4417077,-90.7122047&output=xml
As you can see, for this pair (latitude, longitude) you have 10 possible placemarks for this coordinates.
The documentation for this you can find at: http://code.google.com/apis/maps/documentation/geocoding/index.html
You can see that you get the info in XML, JSON, CSV.
Take a look at the status code, it is important to verify if the request was successful (usually 200 or 200 and something).
So, how to use it VFN?
It is simple.
on locationString is the response from Google Geocoder, now you can use the info as you want. Remember to first check the status code, and than parse the info. If you want only the first placemark that is selected by Google Geocoder, I would suggest you to use the output in CSV, that is easy to work with.
If you have any queries, let me know!
Cheers,
VFN