Center for Geographic Analysis Harvard University
Additional navigation

You are here

Time-Enabled KML Conversion Library

teKML - Time-Enabled KML Conversion Library - is a Java API and commandline application for converting geodata vector files with time attributes into KML with time elements. Geographic data files in many vector formats (including Shapefiles) can be converted with teKML using the ogr2ogr utility program from FWTools.

For geodata source files in formats other than KML, the ogr library from FWTools is used to initially convert to KML. However, the initial ogr conversion process does not reformat the time attributes into KML time elements. teKML subsequently takes KML files (including ogr-converted KML files, ArcMap's Export to KML files, or GoogleEarth produced KML files) and converts them to KML version 2.1, following the KML specification for adding time elements.

The particular conventions of the time attributes such as the identifying labels for the pertinent fields and the time format are specified in a configuration file for a given workflow along with other instructions to teKML.

Benefits of using teKML

  • When opened in GoogleEarth V4 or higher, files processed by teKML will automatically enable the Time Bar control.
  • teKML includes a date handling library, which can specify an incoming date format and automatically convert them to the format required by KML (ISO 8601). teKML takes care of padding dates with zeroes when needed, and is based on a specialized Java date library, allowing for valid dates ranging from -296,000,000 to 296,000,000.
  • teKML uses an XML StAX parser, a technology which makes the processing of large files go quickly.
  • In the case where no date values exist in the source file, teKML can apply a single TimeStamp from the configuration parameters to all the PlaceMarks in a KML folder.

See the teKML User Guide and Download the application.