谷歌地图的地址格式

6

我正在尝试制作一个可以解析可能地址并将其转换为Google地图链接的工具。是否有关于Google Maps所接受的最通用地址格式的参考资料?这似乎是他们想要公开的内容,但我在文档中找不到任何信息。

1个回答

5

你应该看一下Google静态地图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.

In any parameter where you may provide a latitude/longitude, you may instead specify a string indicating an address. Google will geocode the address and provide the Static Map service with a latitude/longitude value to use in placing markers or specifying locations. The string should be URL-escaped, so addresses such as "City Hall, New York, NY" should be converted to "City+Hall,New+York,NY", for example.

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

资源:


2
谢谢。我已经看过了,但它并没有回答哪些字符串将被视为地址的具体问题。尝试不同的格式应该足够了,但我更愿意有一个详尽的答案。 - Erik K.
你不需要将你的字符串转换为“谷歌兼容字符串”,因为谷歌会自动处理。 - Colin Hebert
4
我了解到谷歌会尽可能接受与真实街道地址对应的许多字符串。我正在寻找一个公共参考资料,提供Google Maps尝试解析哪些字符串的广泛描述。如果我能找到这个参考资料,我将以此为标准来判断什么算作地址。如果找不到,我将不依赖此资料。 - Erik K.

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接