Google地图的地址格式

Eri*_* K. 6 regex google-maps

我正在尝试制作解析可能地址的文本并将其转换为Google地图链接的内容.对于Google地图将作为查询接受的最常规地址格式,是否有任何参考?看起来像是他们想要公开的东西,但我在文档中找不到任何东西.

Col*_*ert 5

You should give a look at Google Static Maps API.

Addresses

Most people don't speak in latitudes and longitudes; they denote locations using addresses. The process of turning an address into a geographic point is known as geocoding and the Static Maps service can perform geocoding for you if you provide valid addresses.

在您可以提供纬度/经度的任何参数中,您可以改为指定表示地址的字符串.Google会对地址进行地理编码,并为静态地图服务提供纬度/经度值,以用于放置标记或指定位置.该字符串应该是URL转义的,因此例如"City Hall,New York,NY"等地址应转换为"City + Hall,New + York,NY".

Note that addresses may reflect either precise locations, such as street addresses, polylines such as named routes, or polygonal areas such as cities, countries, or national parks. For polylinear and polygonal results, the Static Map server will use the center point of the line/area as the address center. If you have doubt about how an address may geocode, you can test out the address using this Geocoding Utility.

The following example generates a static map for Berkeley, CA:

http://maps.google.com/maps/api/staticmap?center=Berkeley,CA&zoom=14&size=400x400&sensor=false
Run Code Online (Sandbox Code Playgroud)

Resources :

  • 我了解Google会尝试接受与真实街道地址相对应的尽可能多的字符串.我正在寻找一个公开的参考资料,它提供了Google地图甚至会尝试解析哪些字符串的广泛描述.如果我能找到这个参考,我将把它作为地址的标准.如果没有,我将在没有它的情况下工作. (3认同)
  • 谢谢.我已经看了一下,并没有回答具体的问题,哪些字符串将不会被视为地址.尝试不同的格式应该足够好,但我宁愿有一些详尽的东西. (2认同)