0
votes

I am having a problem with the Google Earth Timeslider. I have created a KML file through excel which includes several different Placemarks. Each line of the code has a TimeStamp for each placemark. However when i open this in Google Earth and use the Timeslider, all the placemarks come up for every timestamp in the file.

For Example if i had 5 Placemarks in the KML file and the Timestamps where an hour apart, then every placemark would appear on each hour rather than only the one with the corresponding timestamp. Does that make sense?

Here is an example of a couple lines of the KML File

<?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>

So in this example both Location 1 and 2 would appear on google earth but they would both show up at 0900 and 1000. instead of only Location 1 appearing at 0900 and only 2 at 1000.

Any help would be appreciated

Regards

John

1
KML file above is not well-formed and will not open in Google Earth. Missing </IconStyle> and </Style> end tags. - JasonM1

1 Answers

0
votes

The example KML is not a well-formed XML file which is required for a valid KML file. For example, the <Style> and <IconStyle> tags have no matching end tag.

Also, the order of the elements in the placemark are non-standard. A valid KML placemark has the Geometry (e.g. Point) as the last element not the description.

To verify the file is a well-formed XML file, first rename the file to have an ".xml" extension then drag file onto a web browser. Any modern web browser (e.g., Chrome, FireFox, etc.) performs basic XML validation. This trick won't work if the file has a .kml extension.

You may want to open the KML in Google Earth then save it to a new file. The new file will show you how Google Earth interpreted each element. If the time, location, etc. get lost then that indicates the source file is invalid.

Further details on KML validation are found at KML Best Practice.