3

有没有办法从 Fusion Tables KML 导出中获取长/纬度坐标?

这是一篇关于它的帖子,但该过程不再起作用:

http://mickschroeder.com/2011/03/fusion-tables-export/

4

2 回答 2

4

如果您的数据是用 lat/longs 编码的,那么您将在导出中得到 lat/longs(以<coordinates>元素的形式。如果您的数据是按地址编码的(我怀疑是您的情况),那么就没有办法直接在导出中获取坐标。相反,KML 文件将包含一个<address>元素。似乎 Google 确实会即时解决地理编码问题,并且不愿意与您分享。

Google 有一个地理编码 API,您可以使用它来将您的地址转换为坐标,前提是您将在 Google 地图上显示地理编码数据。下面是一个在 Python 中使用地理编码 API 的简单示例:

import urllib2, json

# create a request URI for the Google Geocoding API
service_fmt = "https://maps.googleapis.com/maps/api/geocode/json?address={0}&sensor=false"
request_addr = service_fmt.format(urllib2.quote("600 Mountain Ave, New Providence, NJ"))

# make the request and deserialize the JSON response
response_handle = urllib2.urlopen(request_addr)
response = json.loads(response_handle.read())

print(response["results"][0]["geometry"]["location"])
于 2013-07-22T02:14:42.173 回答
2

您可以在 Google 地球中打开导出的 KML,然后通过“将地点另存为...”将其导出到新文件,这将创建一个具有长/纬度坐标的 KML 文件。但是,至少 Google 地球 7.1.2.2041 版会创建具有“点”和“线性环”几何形状的 KML 文件,例如 QGis 难以读取。

于 2014-02-04T15:36:01.740 回答