【问题标题】:Timestamps not displaying correctly in Google Earth时间戳无法在 Google 地球中正确显示
【发布时间】:2017-05-23 22:21:38
【问题描述】:

我在使用 Google 地球时间滑块时遇到问题。我通过 excel 创建了一个 KML 文件,其中包含几个不同的地标。代码的每一行都有每个地标的时间戳。但是,当我在 Google 地球中打开它并使用 Timeslider 时,文件中的每个时间戳都会出现所有地标。

例如,如果我在 KML 文件中有 5 个地标,并且时间戳相隔一小时,那么每个地标都会出现在每个小时,而不仅仅是具有相应时间戳的地标。这有意义吗?

这里是几行 KML 文件的示例

<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://earth.google.com/kml/2.0">
<Document>
<Placemark> 
  <Style> 
    <IconStyle> 
      <Icon>
 <href>http://maps.google.com/mapfiles/kml/shapes/placemark_circle.png</href>
</Icon>
<colorMode>normal</colorMode> 
<color>50009614</color>
  <TimeStamp>
     <when>2017-05-01T09:00:00Z</when>
</TimeStamp>
<name>Location1</name>
<Point> 
<coordinates>"Longitude", "Latitude",0</coordinates>
</Point>
<description><![CDATA["Description"]]></description>
</Placemark>
<Placemark> 
  <Style> 
    <IconStyle> 
      <Icon>
 <href>http://maps.google.com/mapfiles/kml/shapes/placemark_circle.png</href>
</Icon>
<colorMode>normal</colorMode> 
<color>50009614</color>
  <TimeStamp>
     <when>2017-05-01T10:00:00Z</when>
</TimeStamp>
<name>Location2</name>
<Point> 
<coordinates>"Longitude", "Latitude",0</coordinates>
</Point>
<description><![CDATA["Description"]]></description>
</Placemark>
</Document></kml>

所以在这个例子中,位置 1 和 2 都会出现在 google earth 上,但它们都会出现在 0900 和 1000。而不是只有位置 1 出现在 0900 和只有 2 出现在 1000。

任何帮助将不胜感激

问候

约翰

【问题讨论】:

  • 上述 KML 文件格式不正确,无法在 Google 地球中打开。缺少 和 结束标记。

标签: timestamp kml google-earth


【解决方案1】:

示例 KML 不是有效 KML 文件所必需的格式正确的 XML 文件。例如,&lt;Style&gt;&lt;IconStyle&gt; 标签没有匹配的结束标签。

此外,地标中元素的顺序是非标准的。有效的 KML 地标将几何(例如点)作为最后一个元素而不是描述。

要验证文件是格式正确的 XML 文件,首先将文件重命名为具有“.xml”扩展名,然后将文件拖到 Web 浏览器上。任何现代 Web 浏览器(例如 Chrome、FireFox 等)都执行基本的 XML 验证。如果文件具有 .kml 扩展名,则此技巧将不起作用。

您可能希望在 Google 地球中打开 KML,然后将其保存到一个新文件中。新文件将向您展示 Google 地球如何解释每个元素。如果时间、地点等丢失,说明源文件无效。

有关 KML 验证的更多详细信息,请访问 KML Best Practice

【讨论】:

  • 为丢失的
  • 尝试将 KML 文件上传到 KML Validator 并修复它报告的内容。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-01-06
  • 1970-01-01
  • 2019-02-21
  • 1970-01-01
  • 1970-01-01
  • 2011-06-05
  • 1970-01-01
相关资源
最近更新 更多