关于Goole Earth中不能同时导出多个要素的解决方法
利用Goolge Earth导出的KMl 每次只能导出一个要素 比如只能导出一个多边形,没法多个多边形一起导出,这远远无法满足空间数据格式的要求。此时,可以通过组装多个kml文件解决:
操作步骤如下:
1 在Google Earth中画两个多边形,分别输出为Road1.kml、Road2.kml
2 打开两个kml文件,看下文件结构:
Road1.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>Road1.kml</name>
<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-pushpin</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#sh_ylw-pushpin0</styleUrl>
</Pair>
</StyleMap>
<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>
<Placemark>
<name>Roacl</name>
<styleUrl>#msn_ylw-pushpin</styleUrl>
<Polygon>
<tessellate>1</tessellate>
<outerBoundaryIs>
<LinearRing>
<coordinates>
119.2724939491709,26.07590648506107,0 119.2726661257142,26.07581860422928,0 119.2727170483119,26.07574438626704,0 119.2726230794647,26.07569116942871,0 119.2725761091681,26.07582544343338,0 119.2726504626378,26.07587859713583,0 119.2725957283209,26.07603010207334,0 119.2723848713086,26.07639871228048,0 119.2722335404662,26.07668581517006,0 119.2719081327362,26.07737565490027,0 119.2717826094019,26.07736134615011,0 119.2724939491709,26.07590648506107,0 </coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
</Document>
</kml>
Road2.kml 文件结果和Road1.kml类似,
3 组装两个kml文件为一个kml文件
复制Road2.kml中<Placemark>内的内容
<Placemark>
<name>Road2</name>
<styleUrl>#msn_ylw-pushpin</styleUrl>
<Polygon>
<tessellate>1</tessellate>
<outerBoundaryIs>
<LinearRing>
<coordinates>
119.2731836644122,26.07466581955749,0 119.2732421897936,26.07471392958852,0 119.2731837295612,26.07484346043697,0 119.2730778718304,26.07509374187628,0 119.2728403916245,26.07554246522613,0 119.2727342859524,26.07548519481472,0 119.2727183406873,26.07547087915196,0 119.2731836644122,26.07466581955749,0 </coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
打开Road1.kml,把Road2中的Placemark标签放置在Road1的Placemark标签后面,保存为Road.kml,即可。这时在通过arcmap执行导入,即可发现 一个多边形图层含有两个多边形要素。
组装后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>Roacl.kml</name>
<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-pushpin</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#sh_ylw-pushpin0</styleUrl>
</Pair>
</StyleMap>
<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>
<Placemark>
<name>Roacl</name>
<styleUrl>#msn_ylw-pushpin</styleUrl>
<Polygon>
<tessellate>1</tessellate>
<outerBoundaryIs>
<LinearRing>
<coordinates>
119.2724939491709,26.07590648506107,0 119.2726661257142,26.07581860422928,0 119.2727170483119,26.07574438626704,0 119.2726230794647,26.07569116942871,0 119.2725761091681,26.07582544343338,0 119.2726504626378,26.07587859713583,0 119.2725957283209,26.07603010207334,0 119.2723848713086,26.07639871228048,0 119.2722335404662,26.07668581517006,0 119.2719081327362,26.07737565490027,0 119.2717826094019,26.07736134615011,0 119.2724939491709,26.07590648506107,0 </coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
<Placemark>
<name>Road2</name>
<styleUrl>#msn_ylw-pushpin</styleUrl>
<Polygon>
<tessellate>1</tessellate>
<outerBoundaryIs>
<LinearRing>
<coordinates>
119.2731836644122,26.07466581955749,0 119.2732421897936,26.07471392958852,0 119.2731837295612,26.07484346043697,0 119.2730778718304,26.07509374187628,0 119.2728403916245,26.07554246522613,0 119.2727342859524,26.07548519481472,0 119.2727183406873,26.07547087915196,0 119.2731836644122,26.07466581955749,0 </coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
</Document>
</kml>
具体导入方法见:http://www.cnblogs.com/sirc/archive/2010/07/19/1780699.html
Detail.lee
福建省空间信息工程研究中心
2010.07.19