反向地理编码Google地图 [英] Reverse Geocoding google maps

查看:83
本文介绍了反向地理编码Google地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我想点击我的谷歌地图并获取地址(反向地理编码),尤其是该地点的名称.
基本上,这对于"inverseGeocoding"类是可行的,但是该类返回所选地点的地区.

例如:伦敦包括肯辛顿,威斯敏斯特,切尔西等.对于我的应用程序,我需要单击发生在伦敦而不是在Kensighton或切尔西的信息……有人有一些想法吗?

Hello,

I''d like to click on my google map and get the adress (reverse geocoding), especially the name of the place.
Basically this is possible with the class "inverseGeocoding" but this class returns the districts of the selected place.

For instance: London consists of Kensinghton, Westminster, Chelsea, ect. For my app I need the info that the click occurs in London and not in Kensighton or Chelsea...does somebody have some ideas??

Thanks in advance!

推荐答案

"inverseGeocoding"类在哪个库中?

您应该完善您的问题,并确切说明您使用的是哪种库/地理编码服务,以便人们可以对其进行适当的调查.但是,听起来好像显然不能满足您的需求,但是我链接到的Google Webservice确实可以满足您的需求.

您可以在此处找到Google地理编码文档:
http://code.google.com/apis/maps/documentation/geocoding/#ReverseGeocoding [^ ]

反向地理编码API将地址的每个单独部分作为命名组件提供,并带有特定的type.我相信您感兴趣的组件类型是locality.

例如,查询肯辛顿(Kensington)中的地址: http://maps.googleapis.com/maps/api/geocode/xml?latlng=51.4874,-0.1692&sensor=false [
In what library is the "inverseGeocoding" class?

You should refine your question and include exactly what library/geocoding service you are using so that people can investigate it properly. However, it sounds like it obviously does not meet your needs, but the Google webservice which I have linked to does.

The Google Geocoding documentation is available here:
http://code.google.com/apis/maps/documentation/geocoding/#ReverseGeocoding[^]

The reverse geocoding API gives each separate part of the address as a named component, with a specific type. I believe the component type you are interested in is locality.

For example, a query for an address in Kensington: http://maps.googleapis.com/maps/api/geocode/xml?latlng=51.4874,-0.1692&sensor=false[^].

just in case this is still unclear, look at the following XML snippet from the response above:
<address_component>
 <long_name>London</long_name>
 <short_name>London</short_name>
 <type>locality</type>
 <type>political</type>
</address_component>


您应该通过检查type = locality来找到此address_component元素.


You should locate this address_component element by checking for type=locality.


这篇关于反向地理编码Google地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆