我正在尝试将 kml 文件中的纬度和经度设置为稍后使用的变量。我是 C# 新手,到目前为止只能读取整个文件。
我使用 Excel 创建了 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>Earth Point Excel To KML</name>
<open>1</open>
<Snippet maxLines="1">Unity_walk_through.xlsx</Snippet>
<description><![CDATA[Source: Unity_walk_through.xlsx<br/>DateTime: 2013-08-18 11:23:42 UTC<br/><br/>©2013 Earth Point<br/><a target='_blank' href='http://www.earthpoint.us'>www.earthpoint.us</a><br/><br/>For illustration only. User to verify all information.]]></description>
<Style>
<IconStyle>
<Icon>
</Icon>
</IconStyle>
<BalloonStyle>
<text>$[description]</text>
<textColor>ff000000</textColor>
<displayMode>default</displayMode>
</BalloonStyle>
</Style>
<Style id="NormalSheet1Map1">
<IconStyle>
<Icon>
<href>http://www.earthpoint.us/Dots/GoogleEarth/paddle/ltblu-diamond.png</href>
</Icon>
</IconStyle>
<LabelStyle>
</LabelStyle>
<BalloonStyle>
<text>$[description]</text>
</BalloonStyle>
<LineStyle>
<color>ffff00ff</color>
<width>2</width>
</LineStyle>
<PolyStyle>
<color>00ff00ff</color>
<fill>0</fill>
</PolyStyle>
</Style>
<StyleMap id="Sheet1Map1">
<Pair>
<key>normal</key>
<styleUrl>#NormalSheet1Map1</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#HighlightSheet1Map1</styleUrl>
</Pair>
</StyleMap>
<Style id="HighlightSheet1Map1">
<IconStyle>
<scale>1.1</scale>
<Icon>
<href>http://www.earthpoint.us/Dots/GoogleEarth/paddle/ltblu-diamond.png</href>
</Icon>
</IconStyle>
<LabelStyle>
<scale>1.1</scale>
</LabelStyle>
<BalloonStyle>
<text>$[description]</text>
</BalloonStyle>
<LineStyle>
<color>ffff00ff</color>
<width>3</width>
</LineStyle>
<PolyStyle>
<color>70ff00ff</color>
<fill>0</fill>
</PolyStyle>
</Style>
<Folder>
<name>Sheet1</name>
<Placemark>
<name><b/></name>
<Snippet maxLines="0"></Snippet>
<LookAt>
<longitude>-7.899325</longitude>
<latitude>53.41568611</latitude>
<altitude>0</altitude>
<heading>0</heading>
<tilt>0</tilt>
<range>1000</range>
<altitudeMode>relativeToGround</altitudeMode>
</LookAt>
<styleUrl>#Sheet1Map1</styleUrl>
<Style>
<LabelStyle>
<color>00000000</color>
</LabelStyle>
</Style>
<ExtendedData>
</ExtendedData>
<Point>
<coordinates>-7.899325,53.41568611000001,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name><b/></name>
<Snippet maxLines="0"></Snippet>
<LookAt>
<longitude>-7.8991</longitude>
<latitude>53.41593611</latitude>
<altitude>0</altitude>
<heading>0</heading>
<tilt>0</tilt>
<range>1000</range>
<altitudeMode>relativeToGround</altitudeMode>
</LookAt>
<styleUrl>#Sheet1Map1</styleUrl>
<Style>
<LabelStyle>
<color>00000000</color>
</LabelStyle>
</Style>
<ExtendedData>
</ExtendedData>
<Point>
<coordinates>-7.8991,53.41593611,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name><b/></name>
<Snippet maxLines="0"></Snippet>
<LookAt>
<longitude>-7.900325</longitude>
<latitude>53.41701111</latitude>
<altitude>0</altitude>
<heading>0</heading>
<tilt>0</tilt>
<range>1000</range>
<altitudeMode>relativeToGround</altitudeMode>
</LookAt>
<styleUrl>#Sheet1Map1</styleUrl>
<Style>
<LabelStyle>
<color>00000000</color>
</LabelStyle>
</Style>
<ExtendedData>
</ExtendedData>
<Point>
<coordinates>-7.900325,53.41701111,0</coordinates>
</Point>
</Placemark>
</Folder>
</Document>
</kml>