如何搜索Google Earth生成的KML文件? [英] How to Search Google Earth generated KML file?

查看:85
本文介绍了如何搜索Google Earth生成的KML文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



是否可以通过google earth搜索包含地标的KML生成的文件?



例如:



我需要地标元素及其坐标的子元素(名称)的内容。

以其他方式(查看地标的每个名称及其坐标,使其可以通过C#应用程序使用元素(名称)的内容作为关键字进行搜索)



这是KML文件的样本:







Hi all,

Is it possible to search the KML generated file by google earth which contains place marks?

For example:

I need the content of the sub element (Name) for the placemark element and its coordinates.
in other way (view to me every name of the place mark and its coordinates to make it searchable by C# application using the the content of the element (name) as a keyword)

This is a sample of the KML file:



<<?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>default_myplaces_en_US.kml</name>
	<open>1</open>
	<Style id="sh_ylw-pushpin1">
		<IconStyle>
			<scale>1.3</scale>
			<Icon>
				<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
			</Icon>
			<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
		</IconStyle>
	</Style>
	<Style id="sn_ylw-pushpin">
		<IconStyle>
			<scale>1.1</scale>
			<Icon>
				<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
			</Icon>
			<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
		</IconStyle>
	</Style>
	<Style id="sn_ylw-pushpin1">
		<IconStyle>
			<scale>1.1</scale>
			<Icon>
				<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
			</Icon>
			<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
		</IconStyle>
	</Style>
	<Style id="sh_ylw-pushpin0">
		<IconStyle>
			<scale>1.3</scale>
			<Icon>
				<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
			</Icon>
			<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
		</IconStyle>
	</Style>
	<StyleMap id="msn_ylw-pushpin">
		<Pair>
			<key>normal</key>
			<styleUrl>#sn_ylw-pushpin1</styleUrl>
		</Pair>
		<Pair>
			<key>highlight</key>
			<styleUrl>#sh_ylw-pushpin</styleUrl>
		</Pair>
	</StyleMap>
	<StyleMap id="msn_ylw-pushpin0">
		<Pair>
			<key>normal</key>
			<styleUrl>#sn_ylw-pushpin</styleUrl>
		</Pair>
		<Pair>
			<key>highlight</key>
			<styleUrl>#sh_ylw-pushpin1</styleUrl>
		</Pair>
	</StyleMap>
	<StyleMap id="msn_ylw-pushpin1">
		<Pair>
			<key>normal</key>
			<styleUrl>#sn_ylw-pushpin0</styleUrl>
		</Pair>
		<Pair>
			<key>highlight</key>
			<styleUrl>#sh_ylw-pushpin0</styleUrl>
		</Pair>
	</StyleMap>
	<Style id="sn_ylw-pushpin0">
		<IconStyle>
			<scale>1.1</scale>
			<Icon>
				<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
			</Icon>
			<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
		</IconStyle>
	</Style>
	<Style id="default_myplaces_style">
		<IconStyle>
			<Icon>
			</Icon>
		</IconStyle>
	</Style>
	<Style id="sh_ylw-pushpin">
		<IconStyle>
			<scale>1.3</scale>
			<Icon>
				<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
			</Icon>
			<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
		</IconStyle>
	</Style>
	<Folder>
		<name>My Places</name>
		<open>1</open>
		<Style>
			<ListStyle>
				<listItemType>check</listItemType>
				<ItemIcon>
					<state>open</state>
					<href>C:/Program Files (x86)/Google/Google Earth/res/mysavedplaces_open.png</href>
				</ItemIcon>
				<ItemIcon>
					<state>closed</state>
					<href>C:/Program Files (x86)/Google/Google Earth/res/mysavedplaces_closed.png</href>
				</ItemIcon>
				<bgColor>00ffffff</bgColor>
				<maxSnippetLines>2</maxSnippetLines>
			</ListStyle>
		</Style>
		<Placemark>
			<name>1st Placemark</name>
			<LookAt>
				<longitude>-88.6053771201891</longitude>
				<latitude>32.28430709663048</latitude>
				<altitude>0</altitude>
				<range>250.1819494419393</range>
				<tilt>0</tilt>
				<heading>2.055254877575029</heading>
				<altitudeMode>relativeToGround</altitudeMode>
			</LookAt>
			<styleUrl>#msn_ylw-pushpin0</styleUrl>
			<Point>
				<coordinates>-88.6053771201891,32.28430709663048,0</coordinates>
			</Point>
		</Placemark>
		<Placemark>
			<name>2nd Placemark</name>
			<LookAt>
				<longitude>-88.61764632679935</longitude>
				<latitude>32.27910235483834</latitude>
				<altitude>0</altitude>
				<range>1128.948498702121</range>
				<tilt>0</tilt>
				<heading>2.048701985830222</heading>
				<altitudeMode>relativeToGround</altitudeMode>
			</LookAt>
			<styleUrl>#msn_ylw-pushpin1</styleUrl>
			<Point>
				<coordinates>-88.61764632679935,32.27910235483834,0</coordinates>
			</Point>
		</Placemark>
		<Placemark>
			<name>3rd Placemark</name>
			<LookAt>
				<longitude>-88.60302684575669</longitude>
				<latitude>32.26715342195568</latitude>
				<altitude>0</altitude>
				<range>2380.764313737851</range>
				<tilt>0</tilt>
				<heading>2.056509492270209</heading>
				<altitudeMode>relativeToGround</altitudeMode>
			</LookAt>
			<styleUrl>#msn_ylw-pushpin</styleUrl>
			<Point>
				<coordinates>-88.60302684575669,32.26715342195568,0</coordinates>
			</Point>
		</Placemark>
	</Folder>
</Document>
</kml>

推荐答案

KML is XML, so you can use xpath[^]
KML is XML, so you can use xpath[^]


这篇关于如何搜索Google Earth生成的KML文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆