1

I have a KML File with a Folder and 5 overlapping Polygons which each of them has a <Timespan> Element with <Begin> and <end> like the following:

<?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>Pflanzungen.kml</name>
    <open>1</open>
    <Style id="Feld0004">
      <IconStyle>
        <scale>0.4</scale>
        <Icon>
          <href>http://maps.google.com/mapfiles/kml/shapes/star.png</href>
        </Icon>
      </IconStyle>
      <LabelStyle>
        <color>9900ffff</color>
        <scale>1</scale>
      </LabelStyle>
        <LineStyle>
            <color>ff00ffff</color>
            <width>2</width>
        </LineStyle>
        <PolyStyle>
            <color>6600ffff</color>
        </PolyStyle>
    </Style>
    <Style id="Feld0003">
      <IconStyle>
        <scale>0.4</scale>
        <Icon>
          <href>http://maps.google.com/mapfiles/kml/shapes/star.png</href>
        </Icon>
      </IconStyle>
      <LabelStyle>
        <color>9900ffff</color>
        <scale>1</scale>
      </LabelStyle>
        <LineStyle>
            <color>ff0000ff</color>
            <width>2</width>
        </LineStyle>
        <PolyStyle>
            <color>660000ff</color>
        </PolyStyle>
    </Style>
    <Style id="Feld0001">
      <IconStyle>
        <scale>0.4</scale>
        <Icon>
          <href>http://maps.google.com/mapfiles/kml/shapes/star.png</href>
        </Icon>
      </IconStyle>
      <LabelStyle>
        <color>9900ffff</color>
        <scale>1</scale>
      </LabelStyle>
        <LineStyle>
            <color>ff10ff10</color>
            <width>2</width>
        </LineStyle>
        <PolyStyle>
            <color>6610ff10</color>
        </PolyStyle>
    </Style>
    <Style id="Feld0000">
    </Style>
    <Style id="Feld0002">
      <IconStyle>
        <scale>0.4</scale>
        <Icon>
          <href>http://maps.google.com/mapfiles/kml/shapes/star.png</href>
        </Icon>
      </IconStyle>
      <LabelStyle>
        <color>9900ffff</color>
        <scale>1</scale>
      </LabelStyle>
        <LineStyle>
            <color>ffff8418</color>
            <width>2</width>
        </LineStyle>
        <PolyStyle>
            <color>66ff8418</color>
        </PolyStyle>
    </Style>
    <Style id="Feld0005">
      <IconStyle>
        <scale>0.4</scale>
        <Icon>
          <href>http://maps.google.com/mapfiles/kml/shapes/star.png</href>
        </Icon>
      </IconStyle>
      <LabelStyle>
        <color>9900ffff</color>
        <scale>1</scale>
      </LabelStyle>
        <LineStyle>
            <color>ff8080ff</color>
            <width>2</width>
        </LineStyle>
        <PolyStyle>
            <color>668080ff</color>
        </PolyStyle>
    </Style>
    <Folder>
        <name>^Alle</name>
        <open>1</open>
        <styleUrl>#Feld0000</styleUrl>
        <Placemark>
            <name>Test1 2016/19</name>
            <TimeSpan>
        <begin>2016-11-2</begin>
        <end>2019-11-1</end>
            </TimeSpan>
            <styleUrl>#Feld0001</styleUrl>
            <Polygon>
                <outerBoundaryIs>
                    <LinearRing>
                        <coordinates>
                            -77.05860079207011,38.86999379928544,0 -77.05554907665893,38.86880793040165,0 -77.05310313779386,38.87066286135065,0 -77.05464010084096,38.87306915897465,0 -77.05803254214114,38.87281900611599,0 -77.05860079207011,38.86999379928544,0 
                        </coordinates>
                    </LinearRing>
                </outerBoundaryIs>
            </Polygon>
        </Placemark>
        <Placemark>
            <name>Test2 2019/20</name>
            <TimeSpan>
        <begin>2019-11-2</begin>
        <end>2020-11-1</end>
            </TimeSpan>
            <styleUrl>#Feld0002</styleUrl>
            <Polygon>
                <outerBoundaryIs>
                    <LinearRing>
                        <coordinates>
                            -77.05860079207011,38.86999379928544,0 -77.05554907665893,38.86880793040165,0 -77.05310313779386,38.87066286135065,0 -77.05464010084096,38.87306915897465,0 -77.05803254214114,38.87281900611599,0 -77.05860079207011,38.86999379928544,0 
                        </coordinates>
                    </LinearRing>
                </outerBoundaryIs>
            </Polygon>
        </Placemark>
        <Placemark>
            <name>Test3 2020/21</name>
            <TimeSpan>
         <begin>2020-11-2</begin>
        <end>2021-11-1</end>
            </TimeSpan>
            <styleUrl>#Feld0003</styleUrl>
            <Polygon>
                <outerBoundaryIs>
                    <LinearRing>
                        <coordinates>
                            -77.05860079207011,38.86999379928544,0 -77.05554907665893,38.86880793040165,0 -77.05310313779386,38.87066286135065,0 -77.05464010084096,38.87306915897465,0 -77.05803254214114,38.87281900611599,0 -77.05860079207011,38.86999379928544,0 
                        </coordinates>
                    </LinearRing>
                </outerBoundaryIs>
            </Polygon>
        </Placemark>
        <Placemark>
            <name>Test4 2021/22</name>
            <TimeSpan>
        <begin>2021-11-2</begin>
        <end>2022-11-1</end>
      </TimeSpan>
            <styleUrl>#Feld0004</styleUrl>
            <Polygon>
                <outerBoundaryIs>
                    <LinearRing>
                        <coordinates>
                            -77.05860079207011,38.86999379928544,0 -77.05554907665893,38.86880793040165,0 -77.05310313779386,38.87066286135065,0 -77.05464010084096,38.87306915897465,0 -77.05803254214114,38.87281900611599,0 -77.05860079207011,38.86999379928544,0 
                        </coordinates>
                    </LinearRing>
                </outerBoundaryIs>
            </Polygon>
        </Placemark>
        <Placemark>
            <name>Test5 2022/23</name>
            <TimeSpan>
         <begin>2022-11-2</begin>
        <end>2023-11-1</end>
            </TimeSpan>
            <styleUrl>#Feld0005</styleUrl>
            <Polygon>
                <outerBoundaryIs>
                    <LinearRing>
                        <coordinates>
                            -77.05860079207011,38.86999379928544,0 -77.05554907665893,38.86880793040165,0 -77.05310313779386,38.87066286135065,0 -77.05464010084096,38.87306915897465,0 -77.05803254214114,38.87281900611599,0 -77.05860079207011,38.86999379928544,0 
                        </coordinates>
                    </LinearRing>
                </outerBoundaryIs>
            </Polygon>
        </Placemark>
    </Folder>
</Document>
</kml>

Loading this File in Google Earth Pro 7.3.2.5491 (64-bit) for windows 10 does not even show the timeslider. Saving the same File to disk shows, that inside the <TimeSpan> elements is missing each of the <begin> and <end> elements (in all 5 placemarks). The same thing with a bigger file has other errors, sometimes only missing <begin> and at other placemarks only missing the <end>.

If I change in the same file all the <begin> and <end> elements to the form yyyy-mm simply by deleting the "-dd" part. After doing so, the Timeslider works fine as expected. I do not have any idea what could be wrong with the yyyy-mm-dd version.

There has not been reported any error from google earth while loading the file, and I have restarted earth pro with the same results.

0

Your date format is not quite right. Try making the day numbers 2-digits each, for example 2016-11-2 becomes 2016-11-02 (added a zero).

KML dateTime is based on XML Schema time and should be expressed as: yyyy-mm-ddThh:mm:sszzzzzz ... where T is the separator between the date and the time, and the time zone is either Z (for UTC) or zzzzzz, which represents ±hh:mm in relation to UTC. And as you know, it can be expressed as a date only (without the time parts).

More details in the documentation here: https://developers.google.com/kml/documentation/time#how-to-specify-time and here: https://developers.google.com/kml/documentation/kmlreference#timestamp

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.