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
- KML Editors
- Diagramming In Google Maps And Google Earth With Smoot
- Plotting Data In Google Earth Using GE-Graph
- Drawing Grids, Paths And Polygons In Google Earth Using GE-Path
- Online Google Earth Utilities For Buffering And Area Calculations
- Easy Display Of Thematic Data In Google Maps And Google Earth
- Using GIF/PNG Transparency In Displaying Raster Graphics In Google Earth
- Adding Vector Graphic Objects To Google Earth
- Animated GIFs In Google Earth
- Creating A Network KML Link To A Google Spreadsheet
- LIDAR Tools
- EarthPlot Software Tools For Google Earth
- Geographic Time Animations
- Convert TIGER Polygons To KML Files
- Putting Time Data Into A KML File
- Using The KML Time Embedder To Stamp Time Data Into A Google Earth File
- Using The KML Time Embedder, Concluded
- KML Time Embedder Improved With Hour-Minute-Second Ability
- Grid Creation And Path/Polygon Measurements: Two New Online KML Tools
- Google Earth PhotoOverlay Tool
- KML Random Placemark Generator
- Update For Online Google Earth Utilities
- KML Time Code Utility
- Screen Overlays In Google Earth
- The KML Screen Overlay Maker Utility
- KML Screen Overlay Maker Utility, Concluded
- KML Circle Generator
- Creating Google Earth Screen Overlays With EarthPaint
- Text Editor With KML Validation
- Online Spreadsheet To KML Converter
- Version 2.0 Of Google’s Online KML Spreadsheet Mapper Tool Released
- Creating Google Earth Ground Overlays From Georeferenced Images
- Google Earth Ground Overlays With GIF Transparency
- Creating "Transparent" Topo Map Overlays For Google Earth
- Using Google Earth Ground Overlays To Display Shapefile Data
- Converting 3D Objects Into Google Earth Format
- Thematic Mapping In Google Earth
- An Online KML Validator


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