blankblank blank




Putting Time Data Into A KML File



Last year, Google added the capability to embed time data into a KML file, allowing you to create animated time-based data displays and animations (like the examples on this blog on sea level rise animation, or converting animated GIF files into Google Earth animated images). Oddly enough, almost a year later you still can’t add time data to a KML file in Google Earth itself, but have to add it manually using a text editor, or in some limited ways when creating the file. But it’s not a particularly-complicated process, involving adding a few lines of KML code after Feature element tags; examples of Features are:

  • <Folder>
  • <Document>
  • <Placemark>
  • <GroundOverlay>
  • <ScreenOverlay>
  • <PhotoOverlay>
  • <NetworkLink>

The two time-related KML elements are TimeSpan and TimeStamp.

TimeSpan: For a set of data that encompasses a specific interval between two times, you would use the <TimeSpan> KML tag. For example, for a period spanning from August 1, 2000 to September 1, 2003, associating the time data with a <Document> tag would look like this:

<Document>

<TimeSpan>

<begin>2000-08-01</begin>

<end>2003-09-01></end>

</TimeSpan>

The rest of your Document data, followed by the </Document> tag to close it …

For a time period running from a specific start time to the present, you’d just need the <begin>…</begin> part, and leave out the <end>…</end> section; similarly, for a time period running from the indefinite past to a specific time, keep the <end>…</end> section and leave out the <begin>…</begin>.

TimeStamp: For a set of data associated with a specific time, you would use the <TimeStamp> KML tag. If the data in your KML folder is valid for June 6, 1944 at 6 AM:

<Folder>

<TimeStamp>

<when>1944-06-06T06:00:00></when>

</TimeStamp>

The rest of your Folder data, followed by the </Folder> tag to close it …

All of the details for these two time-related KML tags can be found at Google’s KML 2.2 Reference Page, including the proper formatting for date, time, and timezones.

Time data is easy enough to add to a KML file, I suppose, but it would be nice to be able to assign them to a feature directly in Google Earth, for those who don’t want to deal with editing KML files. I suspect that will be added to Google Earth sometime in the future, especially now that ArcGIS Explorer has come out with superior time-handling features, but until then I’ve created another option. In upcoming posts, I’ll describe a simple utility I’ve written that lets you add time data to a Google Earth KML file without having to know any KML.

Other posts in the Google Earth Data Tools series

  1. KML Editors
  2. Diagramming In Google Maps And Google Earth With Smoot
  3. Plotting Data In Google Earth Using GE-Graph
  4. Drawing Grids, Paths And Polygons In Google Earth Using GE-Path
  5. Online Google Earth Utilities For Buffering And Area Calculations
  6. Easy Display Of Thematic Data In Google Maps And Google Earth
  7. Using GIF/PNG Transparency In Displaying Raster Graphics In Google Earth
  8. Adding Vector Graphic Objects To Google Earth
  9. Animated GIFs In Google Earth
  10. Creating A Network KML Link To A Google Spreadsheet
  11. LIDAR Tools
  12. EarthPlot Software Tools For Google Earth
  13. Geographic Time Animations
  14. Convert TIGER Polygons To KML Files
  15. Putting Time Data Into A KML File
  16. Using The KML Time Embedder To Stamp Time Data Into A Google Earth File
  17. Using The KML Time Embedder, Concluded
  18. KML Time Embedder Improved With Hour-Minute-Second Ability
  19. Grid Creation And Path/Polygon Measurements: Two New Online KML Tools
  20. Google Earth PhotoOverlay Tool
  21. KML Random Placemark Generator
  22. Update For Online Google Earth Utilities
  23. KML Time Code Utility
  24. Screen Overlays In Google Earth
  25. The KML Screen Overlay Maker Utility
  26. KML Screen Overlay Maker Utility, Concluded
  27. KML Circle Generator
  28. Creating Google Earth Screen Overlays With EarthPaint
  29. Text Editor With KML Validation
  30. Online Spreadsheet To KML Converter
  31. Version 2.0 Of Google’s Online KML Spreadsheet Mapper Tool Released
  32. Creating Google Earth Ground Overlays From Georeferenced Images
  33. Google Earth Ground Overlays With GIF Transparency
  34. Creating "Transparent" Topo Map Overlays For Google Earth
  35. Using Google Earth Ground Overlays To Display Shapefile Data
  36. Converting 3D Objects Into Google Earth Format
  37. Thematic Mapping In Google Earth
  38. An Online KML Validator

Looking for something else? Enter some keywords below, then click "Search".
"This site" searches Free Geography Tools; "Web" searches the Internet using Google.
 



0 Responses to “Putting Time Data Into A KML File”


  1. No Comments

Leave a Reply


I welcome all legitimate comments. But spammers should know that my spam filters are currently blocking almost 100% of comment spam, and any that gets through the filters is immediately deleted. Don't believe me? Try posting a spam comment, and see what happens.

Powered by WP Hashcash