通过时间戳的KML时间动画

时间:2018-12-15 14:16:13

标签: kml timespan

我遇到了KML函数时间戳记的问题。我有一个PolygonObjects,每个对象都有定义的时间戳,包括开始和结束信息。我的问题是:多边形是否在定义的结束日期消失?在我的情况下,多边形也会在定义的结束时间之后显示。我也通过网络上的KML示例进行了尝试。还是有其他原因,为什么要定义结束标签?否则,仅使用begin-tag会给我相同的结果。

附带代码:

<?xml version="1.0" encoding="utf-8" ?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Document id="root_doc">
<Schema name="Flood_2017_KML_AnimatonFormatted" id="Flood_2017_KML_AnimatonFormatted">
	<SimpleField name="ID" type="int"></SimpleField>
	<SimpleField name="GlideNumbe" type="string"></SimpleField>
	<SimpleField name="Country" type="string"></SimpleField>
	<SimpleField name="OtherCount" type="string"></SimpleField>
	<SimpleField name="long" type="float"></SimpleField>
	<SimpleField name="lat" type="float"></SimpleField>
	<SimpleField name="Area" type="float"></SimpleField>
	<SimpleField name="Began" type="string"></SimpleField>
	<SimpleField name="Ended" type="string"></SimpleField>
	<SimpleField name="Validation" type="string"></SimpleField>
	<SimpleField name="Dead" type="int"></SimpleField>
	<SimpleField name="Displaced" type="int"></SimpleField>
	<SimpleField name="MainCause" type="string"></SimpleField>
	<SimpleField name="Severity" type="float"></SimpleField>
</Schema>
<Folder><name>Flood_2017_KML_AnimatonFormatted</name>
  <Style id="style1">
	<LineStyle>
		<color>40000000</color>
		<width>3</width>
	</LineStyle>
	<PolyStyle>
		<color>ffe7dcc3</color>
		<fill>1</fill>
		<outline>1</outline>
	</PolyStyle>
</Style>
  <Placemark>
  <TimeSpan>
	<begin>2017-01-05</begin>
	<end>2017-01-21</end>
  </TimeSpan>
	<styleUrl>#style1</styleUrl>
	<ExtendedData><SchemaData schemaUrl="#Flood_2017_KML">
		<SimpleData name="ID">4435</SimpleData>
		<SimpleData name="Country">Brazil</SimpleData>
		<SimpleData name="OtherCount">Argentina</SimpleData>
		<SimpleData name="long">-55.551237000000000</SimpleData>
		<SimpleData name="lat">-29.409362000000002</SimpleData>
		<SimpleData name="Area">386846.737648000009358</SimpleData>
		<SimpleData name="Began">2017/01/05</SimpleData>
		<SimpleData name="Ended">2017/01/21</SimpleData>
		<SimpleData name="Validation">News</SimpleData>
		<SimpleData name="Dead">0</SimpleData>
		<SimpleData name="Displaced">0</SimpleData>
		<SimpleData name="MainCause">Heavy Rain</SimpleData>
		<SimpleData name="Severity">1.000000000000000</SimpleData>
	</SchemaData></ExtendedData>
      <MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>-50.157155,-29.908609 -52.829453,-32.783281 -57.184308,-30.500116 -60.747372,-27.423964 -60.94532,-26.035444 -54.808933,-26.831911 -50.157155,-29.908609</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>
  </Placemark>
  <Placemark>
  <TimeSpan>
	<begin>2017-01-20</begin>
	<end>2017-01-21</end>
  </TimeSpan>
	<styleUrl>#style1</styleUrl>
	<ExtendedData><SchemaData schemaUrl="#Flood_2017_KML">
		<SimpleData name="ID">4438</SimpleData>
		<SimpleData name="Country">USA</SimpleData>
		<SimpleData name="long">-119.043052000000003</SimpleData>
		<SimpleData name="lat">35.083903999999997</SimpleData>
		<SimpleData name="Area">74443.110646300003282</SimpleData>
		<SimpleData name="Began">2017/01/20</SimpleData>
		<SimpleData name="Ended">2017/01/21</SimpleData>
		<SimpleData name="Validation">News</SimpleData>
		<SimpleData name="Dead">0</SimpleData>
		<SimpleData name="Displaced">0</SimpleData>
		<SimpleData name="MainCause">Heavy Rain</SimpleData>
		<SimpleData name="Severity">1.000000000000000</SimpleData>
	</SchemaData></ExtendedData>
      <MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>-118.003825,33.546575 -119.191513,33.943864 -120.478175,34.341202 -121.170993,35.333279 -118.597669,36.621234 -116.915111,34.835276 -118.003825,33.546575</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>
  </Placemark>
  <Placemark>
  <TimeSpan>
	<begin>2017-02-01</begin>
	<end>2017-02-07</end>
  </TimeSpan>
	<styleUrl>#style1</styleUrl>
	<ExtendedData><SchemaData schemaUrl="#Flood_2017_KML">
		<SimpleData name="ID">4441</SimpleData>
		<SimpleData name="Country">Peru</SimpleData>
		<SimpleData name="long">-77.572950000000006</SimpleData>
		<SimpleData name="lat">-5.250831000000000</SimpleData>
		<SimpleData name="Area">288499.131403999985196</SimpleData>
		<SimpleData name="Began">2017/02/01</SimpleData>
		<SimpleData name="Ended">2017/02/07</SimpleData>
		<SimpleData name="Validation">News</SimpleData>
		<SimpleData name="Dead">1</SimpleData>
		<SimpleData name="Displaced">12000</SimpleData>
		<SimpleData name="MainCause">Heavy Rain</SimpleData>
		<SimpleData name="Severity">1.000000000000000</SimpleData>
	</SchemaData></ExtendedData>
      <MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>-78.859612,-8.472832 -80.740118,-5.695045 -79.255508,-4.505716 -77.57295,-2.721449 -74.405783,-2.02883 -74.702704,-5.995598 -78.859612,-8.472832</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>
  </Placemark>
  <Placemark>
  <TimeSpan>
	<begin>2017-02-24</begin>
	<end>2017-03-03</end>
  </TimeSpan>
	<styleUrl>#style1</styleUrl>
	<ExtendedData><SchemaData schemaUrl="#Flood_2017_KML">
		<SimpleData name="ID">4445</SimpleData>
		<SimpleData name="Country">Chile</SimpleData>
		<SimpleData name="long">-70.248874999999998</SimpleData>
		<SimpleData name="lat">-30.939481000000001</SimpleData>
		<SimpleData name="Area">183781.025771999993594</SimpleData>
		<SimpleData name="Began">2017/02/24</SimpleData>
		<SimpleData name="Ended">2017/03/03</SimpleData>
		<SimpleData name="Validation">News</SimpleData>
		<SimpleData name="Dead">3</SimpleData>
		<SimpleData name="Displaced">1200</SimpleData>
		<SimpleData name="MainCause">Heavy Rain</SimpleData>
		<SimpleData name="Severity">2.000000000000000</SimpleData>
	</SchemaData></ExtendedData>
      <MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>-70.644771,-35.947863 -72.030407,-36.04634 -71.733485,-32.277917 -71.634511,-29.699471 -70.842719,-26.129643 -69.852979,-25.832622 -68.467343,-26.626701 -69.358109,-28.411367 -69.951953,-30.4937 -70.347849,-31.782749 -70.248875,-33.072047 -70.644771,-35.947863</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>
  </Placemark>
  </Folder>
</Document></kml>

1 个答案:

答案 0 :(得分:0)

您正在使用什么来查看此KML?如果是Google Earth Pro,那么您的KML应该可以按原样工作(对我来说是如此)。请检查时间滑块的使用方式,因为它可能有些棘手。如果仅移动滑块的末端手柄,则可以有效地查看更大或更小的时间范围以及该范围内的所有功能。如果同时移动滑块的开始和结束手柄,则应在时间上移动一小片,并应看到带有TimeSpans的多边形按预期方式出现和消失。让我们知道这是否不适合您。