试图构造一个KML文件来显示lat长网格和样本点

时间:2017-09-10 02:44:26

标签: google-maps kml

我有一个复杂的KML文件来构建

我需要画出4条纬线:

52.33812724 52.33820125 52.33827526 52.33834927

和88个经度线:

-106.285181641440000
-106.285155147508000
-106.285128653577000
-106.285102159645000
-106.285075665714000
-106.285049171782000
-106.285022677851000
-106.284996183919000
-106.284969689988000
-106.284943196056000
-106.284916702125000
-106.284890208193000
-106.284863714261000
-106.284837220330000
-106.284810726398000
-106.284784232467000
-106.284757738535000
-106.284731244604000
-106.284704750672000
-106.284678256741000
-106.284651762809000
-106.284625268878000
-106.284598774946000
-106.284572281015000
-106.284545787083000
-106.284519293152000
-106.284492799220000
-106.284466305289000
-106.284439811357000
-106.284413317426000
-106.284386823494000
-106.284360329563000
-106.284333835631000
-106.284307341700000
-106.284280847768000
-106.284254353837000
-106.284227859905000
-106.284201365973000
-106.284174872042000
-106.284148378110000
-106.284121884179000
-106.284095390247000
-106.284068896316000
-106.284042402384000
-106.284015908453000
-106.283989414521000
-106.283962920590000
-106.283936426658000
-106.283909932727000
-106.283883438795000
-106.283856944864000
-106.283830450932000
-106.283803957001000
-106.283777463069000
-106.283750969138000
-106.283724475206000
-106.283697981275000
-106.283671487343000
-106.283644993412000
-106.283618499480000
-106.283592005549000
-106.283565511617000
-106.283539017686000
-106.283512523754000
-106.283486029823000
-106.283459535891000
-106.283433041960000
-106.283406548028000
-106.283380054097000
-106.283353560165000
-106.283327066234000
-106.283300572302000
-106.283274078371000
-106.283247584439000
-106.283221090508000
-106.283194596576000
-106.283168102645000
-106.283141608713000
-106.283115114781000
-106.283088620850000
-106.283062126918000
-106.283035632987000
-106.283009139056000
-106.282982645124000
-106.282956151193000
-106.282929657261000
-106.282903163330000
-106.282876669398000
-106.282903163330000

以及一系列我想成为简单红点的样本点

看起来像这样:

**Lat                     Long
52.338129160000000000   -106.28331185333300
52.338129123333300000   -106.28330918666700
52.338129173333300000   -106.28330423833300
52.338129196666700000   -106.28330190333300
52.338129283333300000   -106.28329948000000
52.338129258333300000   -106.28329752166700
52.338129241666700000   -106.28329308000000**

到目前为止,我有这个甚至没有绘制点

<?xml version="1.0" encoding="UTF-8"?>

<kml xmlns="http://www.opengis.net/kml/2.2">

<Document>

<Placemark>

    <Point>

        <coordinates>52.338344750000000,-106.285246311667000,0</coordinates>

    </Point>

</Placemark>

<Placemark>

    <Point>

        <coordinates>52.338129160000000,-106.283311853333000,0</coordinates>

    </Point>

</Placemark>

<Placemark>

    <Point>

        <coordinates>52.338272905000000,-106.284936286667000,0</coordinates>

    </Point>

</Placemark>

</Document>

</kml>

我想知道是否有任何工具来构建KML文件而不是手工编码。有没有像我见过的ESRI工具那样你可以绘制线条点等等。

1 个答案:

答案 0 :(得分:1)

您可以使用Google地球(GE)专业版创建KML。

这是第一行:

    <Placemark>
    <name>Untitled Path</name>
    <LineString>
        <tessellate>1</tessellate>
        <coordinates>
            -106.283830450932,52.33812724,0 -106.283803957001,52.33812724,0 -106.283777463069,52.33812724,0 -106.283750969138,52.33812724,0 -106.283724475206,52.33812724,0 -106.283697981275,52.33812724,0 -106.283671487343,52.33812724,0 -106.283644993412,52.33812724,0 -106.28361849948,52.33812724,0 -106.283592005549,52.33812724,0 -106.283565511617,52.33812724,0 -106.283539017686,52.33812724,0 -106.283512523754,52.33812724,0 -106.283486029823,52.33812724,0 -106.283459535891,52.33812724,0 -106.28343304196,52.33812724,0 -106.283406548028,52.33812724,0 -106.283380054097,52.33812724,0 -106.283353560165,52.33812724,0 -106.283327066234,52.33812724,0 -106.283300572302,52.33812724,0 -106.283274078371,52.33812724,0 -106.283247584439,52.33812724,0 -106.283221090508,52.33812724,0 -106.283194596576,52.33812724,0 -106.283168102645,52.33812724,0 -106.283141608713,52.33812724,0 -106.283115114781,52.33812724,0 -106.28308862085,52.33812724,0 -106.283062126918,52.33812724,0 -106.283035632987,52.33812724,0 -106.283009139056,52.33812724,0 -106.282982645124,52.33812724,0 -106.282956151193,52.33812724,0 -106.282929657261,52.33812724,0 -106.28290316333,52.33812724,0 -106.282876669398,52.33812724,0 -106.28290316333,52.33812724,0 
        </coordinates>
    </LineString>
</Placemark>

您可以复制文本并将其粘贴到GE临时位置。

使用文本编辑器并将上面的Lat替换为下一个,重复所有四个。

请注意,您可以从GE复制/粘贴KML - 只需右键单击一个对象,然后复制即可获取该对象的KML。您可以将代码粘贴到编辑器中。在选择粘贴KML之后,您将创建一个GE文件夹(右键单击粘贴。)

要添加点,只需在GE中添加一个点,复制KML,然后按一下编辑器进行更改以满足您的需求。如果您有很多分数,请创建一个X,Y文件并将其导入GE。

X,Y,Z -106.283830450932000,52.33812724,0 -106.283803957001000,52.33812724,0 -106.283777463069000,52.33812724,0 -106.283750969138000,52.33812724,0 -106.283724475206000,52.33812724,0 -106.283697981275000,52.33812724,0 ...

我在这里有Z,因为我用它来创建地标线,X,Y导入不需要。

您也可以使用文件而不是剪贴板。

一个有用的编辑器是Visual Studio Code或Notepad ++ - 它们都支持XML格式的数据。