由于您要求提供指南,因此示例 kml 文档如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Placemark>
<name>New York City</name>
<description>New York City</description>
<Point>
<coordinates>-74.006393,40.714172,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>
看来你可以保持<name>字段不变,你可以将xml字段<city,<state>,<country>中的项目组合到klm字段<address>city,state,country</address>或将其用作kml<description>标签(出现的用户提供的内容在描述气球中),因为如果提供了点而不是使用地址,kml 将使用 long 和 lat 来确定点。将xml中的<longitute>,<latitudite>转换成kml需要的<point><cordinates>longitute,latatude</cordinates></point>
所以你需要将你的 klm 文件转换成这样的:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Placemark>
<name>Sharon Appartments</name>
<description>Dallas, California, USA</description>
<Point>
<coordinates>115.23412,34.734121</coordinates>
</Point>
</Placemark>
<Placement>
Put item 2 details here
</Placement>
.
.
.
<Placement>
Put item 20000 details here
</Placement>
</Document>
</kml>
我从https://developers.google.com/kml/documentation/kmlreference 得到这个,
现在对于热图部分,如果您可以将文件转换为经纬度列表,则可以将其放入此网页上的 python 程序中:http://jjguy.com/heatmap/,它将为基于谷歌地图的 kml 叠加在该数据上,您需要将该叠加层与您的城市数据的 kml 文件相结合,以获得完整的地图。