0
我的目標是能夠使用KML文件在谷歌地球上定義的區域上繪製陰影多邊形。我創建了一個帶有一個地標和一個具有所需座標的多邊形的KML文檔,並且可以將該文件導入Google My maps並顯示該多邊形。但是,當我用google earth打開同一個文件時,座標似乎被解析得不同,多邊形不正確(請參見圖像)。在我的KML文件中是否存在導致Google地球執行此操作的內容?Google地球爲什麼改變KML多邊形座標?
這些是原始文件座標。
<coordinates>
149.02126, -36.489864, 100
149.3816, -36.31477, 100
149.25783, -36.134285, 100
148.9647, -36.4074, 100
149.02126, -36.489864, 100
</coordinates>
如果我從谷歌地球複製多邊形並粘貼到一個文本文件作爲KML我得到以下座標
<coordinates>
149.02126,-36.489864,100
149.3816,0,0
-36.31477,100,0
149.25783,-36.134285,100
148.9647,-36.4074,100
149.02126,-36.489864,100
</coordinates>
完整的原始KML文件:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Style id="examplePolyStyle">
<PolyStyle>
<color>7f0000ff</color>
<colorMode>random</colorMode>
<fill>1</fill>
<outline>1</outline>
</PolyStyle>
</Style>
<Placemark>
<name>ID: AU201502070705001Issued: 2015-02-07T07:53:00.000Z</name>
<description>Begins: 2015-02-07T07:53:00.000ZEnds: 2015-02-07T08:38:00.000Z</description>
<styleUrl>#examplePolyStyle</styleUrl>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>149.02126, -36.489864, 100 149.3816, -36.31477, 100 149.25783, -36.134285, 100 148.9647, -36.4074, 100 149.02126, -36.489864, 100</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
</Document>
</kml>
完整的KML文件從谷歌地球
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>Latest_Single_noCommaNoSpaces.kml</name>
<Style id="examplePolyStyle">
<PolyStyle>
<color>7f0000ff</color>
<colorMode>random</colorMode>
</PolyStyle>
</Style>
<Placemark>
<name>ID: AU201502070705001Issued: 2015-02-07T07:53:00.000Z</name>
<description>Begins: 2015-02-07T07:53:00.000ZEnds: 2015-02-07T08:38:00.000Z</description>
<styleUrl>#examplePolyStyle</styleUrl>
<gx:balloonVisibility>1</gx:balloonVisibility>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>
149.02126,-36.489864,100
149.3816,0,0
-36.31477,100,0
149.25783,-36.134285,100
148.9647,-36.4074,100
149.02126,-36.489864,100
</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
</Document>
</kml>
複製
感謝您解決這個問題,我非常感激。 – Matt 2015-02-10 17:35:31