KML 模糊背景,多边形除外



我有一个带有公司工作区多边形的 kml。

我想模糊整个外部,以清楚地突出这个区域不在范围内。 注意:在屏幕截图上,红边是多边形的一种样式。我会删除它。 关于如何做到这一点的任何想法?

模糊的外多边形示例

kml 中的代码(删除了不相关的部分(

<?xml version="1.0" encoding="utf-8" ?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document id="root_doc">
<Folder>
<name>Angervilliers_AL8</name>
<Placemark>
<name>Angervilliers</name>
<Style>
<LineStyle>
<color>ff0000ff</color>
</LineStyle>
<PolyStyle>
<fill>0</fill>
</PolyStyle>
</Style>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>1.8823674,48.5142152 1.8837864,48.5138449 ...</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
</Folder>
</Document>
</kml>

要获得此效果,您需要创建一个更大的多边形轮廓来覆盖"模糊"区域,然后为多边形中的"孔"(您希望在中间保持清晰的区域(创建一条内线。这些标签进入<outerBoundaryIs>,并在您的<Polygon>标签内<innerBoundaryIs>标签。

下面是一个工作示例...尝试将其复制/粘贴到地球专业版中。 另请注意强制视图放大内部多边形的<LookAt>部分,因此用户不会注意到多边形的外部边界,除非他们缩小。

<?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">
<Document id="root_doc">
<name>Inverted Polygon Demo</name>
<Placemark>
<name>Angervilliers</name>
<LookAt>
<longitude>2.06384</longitude>
<latitude>48.59146</latitude>
<heading>0</heading>
<tilt>0</tilt>
<range>3000</range>
</LookAt>               
<Style>
<LineStyle>
<color>ff0000ff</color>
</LineStyle>
<PolyStyle>
<fill>1</fill>
<color>88ffffff</color>
</PolyStyle>
</Style>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>
0.3184451839056446,47.78618899775447,0 3.661259487435122,47.80641551814697,0 3.695580055346501,49.36244976492695,0 0.2356130804739087,49.36861085533987,0 0.3184451839056446,47.78618899775447,0 
</coordinates>
</LinearRing>
</outerBoundaryIs>
<innerBoundaryIs>
<LinearRing>
<coordinates>
2.058365295534554,48.59459332179971,0 2.055806623017014,48.59347610558855,0 2.051167395626068,48.59309196143701,0 2.053826722439367,48.59152032273916,0 2.059404688365358,48.5906235533257,0 2.058795280866135,48.58977412250532,0 2.053976866512941,48.58818157946221,0 2.055353500059218,48.58521810150005,0 2.060326614008405,48.58453057119874,0 2.06261321438489,48.59037827408845,0 2.065888887077823,48.59124861689973,0 2.071575394540492,48.59109027523166,0 2.075460981003194,48.59050363005721,0 2.077744729364595,48.59052448781961,0 2.078079473747407,48.59149049454836,0 2.072318523336512,48.59352956508539,0 2.072078869584328,48.59455791455283,0 2.068689814773501,48.59359361048438,0 2.068109548294674,48.59488295734163,0 2.064472047819985,48.5969248658065,0 2.060703393863961,48.59688230010441,0 2.058365295534554,48.59459332179971,0 
</coordinates>
</LinearRing>
</innerBoundaryIs>                  
</Polygon>
</Placemark>
</Document>
</kml>

相关内容

  • 没有找到相关文章

最新更新