0
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
    <name>cwvtrial.kml</name>
    <Placemark>
        <name>PawneeNationalGrasslandBirdingLoop</name>
        <Point>
            <coordinates>-104.336274,40.642254,0</coordinates>
        </Point>
    </Placemark>
    <Placemark>
        <name>PawneeButtes</name>
        <Point>
            <coordinates>-104.00072,40.814517,0</coordinates>
        </Point>
    </Placemark>
    <Placemark>
        <name>TamarackRanchStateWildlifeArea</name>
        <Point>
            <coordinates>-102.804758,40.822466,0</coordinates>
        </Point>
    </Placemark>
    <Placemark>
        <name>RedLionJumboReservoirStateWildlifeArea</name>
        <Point>
            <coordinates>-102.669417,40.896904,0</coordinates>
        </Point>
    </Placemark>
    <Placemark>
        <name>PrewittReservoirStateWildlifeArea</name>
        <Point>
            <coordinates>-103.328779,40.430521,0</coordinates>
        </Point>
    </Placemark>
    <Placemark>
        <name>JacksonLake</name>
        <Point>
            <coordinates>-104.096527,40.391156,0</coordinates>
        </Point>
    </Placemark>
    <Placemark>
        <name>SouthPlatteRiverEagleDrivingTour</name>
        <Point>
            <coordinates>-103.826038,40.266986,0</coordinates>
        </Point>
    </Placemark>
    <Placemark>
        <name>GreaterPrairieChickenLeks</name>
        <Point>
            <coordinates>-102.219793,40.238643,0</coordinates>
        </Point>
    </Placemark>
    <Placemark>
        <name>BonnyLakeStateParkSouthRepublicanSWA</name>
        <Point>
            <coordinates>-102.255351,39.620417,0</coordinates>
        </Point>
    </Placemark>
    <Placemark>
        <name>FlaglerReservoirStateWildlifeArea</name>
        <Point>
            <coordinates>-102.994292,39.293958,0</coordinates>
        </Point>
    </Placemark>
    <Placemark>
        <name>LimonWetland</name>
        <Point>
            <coordinates>-103.677844,39.258691,0</coordinates>
        </Point>
    </Placemark>
    <Placemark>
        <name>SimlaPronghornLoop</name>
        <Point>
            <coordinates>-104.033625,39.160838,0</coordinates>
        </Point>
    </Placemark>
    <Placemark>
        <name>KinneyStateWildlifeArea</name>
        <Point>
            <coordinates>-103.43689,38.906778,0</coordinates>
        </Point>
    </Placemark>
    <Placemark>
        <name>FountainCreekRegionalPark</name>
        <Point>
            <coordinates>-104.726281,38.722361,0</coordinates>
        </Point>
    </Placemark>
    <Placemark>
        <name>ChicoBasin</name>
        <Point>
            <coordinates>-104.345359,38.651998,0</coordinates>
        </Point>
    </Placemark>
    <Placemark>
        <name>RockyFordStateWildlifeArea</name>
        <Point>
            <coordinates>-103.682054,38.065433,0</coordinates>
        </Point>
    </Placemark>
    <Placemark>
        <name>AdobeCreekReservoirStateWildlifeArea</name>
        <Point>
            <coordinates>-103.268029,38.256757,0</coordinates>
        </Point>
    </Placemark>
    <Placemark>
        <name>QueensStateWildlifeArea</name>
        <Point>
            <coordinates>-102.722507,38.334479,0</coordinates>
        </Point>
    </Placemark>
    <Placemark>
        <name>WillowCreekPark</name>
        <Point>
            <coordinates>-102.61408,38.077685,0</coordinates>
        </Point>
    </Placemark>
    <Placemark>
        <name>JohnMartinReservoirStateWildlifeArea</name>
        <Point>
            <coordinates>-102.988342,38.034914,0</coordinates>
        </Point>
    </Placemark>
</Document>
</kml>

所以当我取出文档标签下的第一个名字标签时,我得到了这个工作。当我尝试使用另一个文件(对我来说看起来完全一样)时,真正的问题出现了,该文件是通过用 Java 程序解析 xml 文档来创建的。我可以加载在记事本中创建的文件,但是当我尝试加载程序生成的文件时会出现格式不正确的错误。与我的编码有关吗?但我不知道如何改变它。

4

2 回答 2

2

将文件重命名为 xml,然后在 Internet 浏览器或任何其他 Xml 编辑器中打开。然后你看看你是否有不匹配的打开关闭标签的问题。

我检查了你的文件,它有效!

黄色标记,美国地标。一切都好。检查您的 Google 地球安装。

请注意:要在谷歌地图上显示 km lfile,该文件必须位于公共可访问的 URL 上。谷歌地球没有这个限制

于 2012-12-03T17:39:16.687 回答
0

我发现了问题。这是不匹配的标签。让你感觉很笨,但似乎在编程中经常发生。容易错过的小事。所以一定要检查好标签。根本不是编码。

于 2012-12-03T19:47:05.480 回答