Print This Post

Dealing with time in GML

Virtually all geographic phenomena involve time. It should come as no surprise then that GML provides constructs for the description of time, and for the representation of time dependent geographic features. GML can be used to describe a wide variety of features that are time dependent from the motion of a person or vehicle, to the development of a hurricane and the impact zone of an earthquake.

The description of time is handled by the temporal.xsd schema. This schema defines the key GML temporal objects, namely:

  • TimePeriod
  • TimeInstant

The description of the temporal development of a geographic feature or features is handled in the dynamicfeature.xsd which we will discuss in more detail a little later on.

TimeInstant models a moment in time and has the following structure.

1
2
3
  <gml:TimeInstant>
    <gml:timePosition>2003-02-13T12:28-08:00</gml:timePosition>
  </gml:TimeInstant>
Several time representations are possible for timePosition including:
  • XML Schema time or dataTime (this is also based on ISO 8601)
  • CalDate – enables a very llexible encoding of calendar dates.
  • A URI reference
  • A decimal value

The interpretation of the timePosition value is determined by the optional attributes of timePosition. In particular the frame attribute allows the user to specify the temporal reference system to be used for interpretation of the value of gml:timePosition.

A temporal reference system can be defined in GML using the temporalReference.xsd. Such a definition might live in a coordinate reference system dictionary, possibly managed by a registry such as the OGC Web Registry Service (WRS). The frame attrbute could then reference this definition. Alternatively it could point to some other definition expressed as text ir in some other grammar.

TimePeriods are defined in the same menner. A TimePeriod (a temporal duration or interval) can be expressed in a number of different ways to allow users to tradeoff between expressiveness and simplicity. These different forms include:

1
2
3
4
  <gml:TimePeriod>
    <gml:begin>2003-02-13T12:28-08:00</gml:begin>
    <gml:end>2003-02-13T12:30-08:00</gml:end>
  </gml:TimePeriod>

Here the begin, end elements are timePositions and carry the same attributes as the timePosition discussed above.

1
2
3
4
5
6
7
8
  <gml:TimePeriod>
    <gml:beginPosition>
      <gml:TimeInstant>
        <gml:timePosition>2003-02-13T12:28-08:00</gml:timePosition>
      </gml:TimeInstant>
    </gml:beginPosition>
    <gml:endPosition xlink:href="… #T001"/>
  </gml:TimePeriod>

Note that this form allows the TimePeriod to be defined by TimeInstant objects and allows those TimeInstant objects to be remotely referenced using the xlink:href attribute. This means that TimeInstants can be shared across multiple TimePeriod definitions. And finally:

1
2
3
  <gml:TimePeriod gml:id="T001">
    <gml:duration>PT130S</gml:duration>
  </gml:TimePeriod>

This form allows the expression of a time period by its length rather than by begin and end positions in time. The value type of gml:duration is xsd:duration, which is defined by ISO 8601 (see http://books.xmlschemata.org/relaxng/ch19-77073.html) for additional details.

Time constructs are typically used as the values of temporal properties of features. These might describe the creation or termination "time" of the feature, "effective" dates, the time of sensor observations, or the time at which a feature was in a particular state.

GML includes two models to describe the time evoluation of a feature (an object of interest). These are:

  • SnapShot
  • TimeSlice or time history

A SnapShot is a view of a feature at an instant in time or over an interval in time (depending on the time construct used). A snapshot has a single time property whose value is a TimePeriod or a TimeInstant. For example:

1
2
3
4
5
6
7
  <abc:Company gml:id="L31">
    <gml:name>General Motors</gml:name>
    <abc:location></abc:location>
    <abc:founded>
      <gml:TimeInstant>.. </gml:TimeInstant>
    </abc:founded>
  </abc:Company>

Each snapshot is an individual view of the feature in question and GML implies no organization of the snap shots into any sort of temporal evolution.

Such a view is, however, provided by the Dynamic Feature. A Dynamic Feature is a feature with a gml:history property, the value of which is a set of gml:TimeSlices. The time invariant properties of the feature are outside the history property. TimeSlices contain the time varying properties of the feature. The properties in a TimeSlice are determined by the application schema for the TimeSlice just as they are for the feature as a whole. Users can thus define more or less arbitrary time dependent properties for a feature. A dynamic feature has the folowing general structure:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  <abc:Hurricane gml:id="I01">
    <gml:name>Katrina</gml:name>
    <gml:history>
      <abc:TimeView gml:id="H01">
        <gml:validTime>
          <gml:TimeInstant> .. </gml:TimeInstant>
        </gml:validTime>
        <abc:position> .. </abc:position>
        <abc:windSpeed> .. </abc:windSpeed>
        <abc:category> .. </abc:category>
      </abc:TimeView>
      ...
      <abc:TimeView gml:id="H01">
        <gml:validTime>
          <gml:TimeInstant> .. </gml:TimeInstant>
        </gml:validTime>
        <abc:position> .. </abc:position>
        <abc:windSpeed> .. </abc:windSpeed>
        <abc:category> .. </abc:category>
      </abc:TimeView>
    </gml:history>
  </abc:Hurricane>

Note that by having such a standard structure, software can be written which can visualize or analyze the hisory of a feature instance. Note that this also avoids propblems with handling multiple feature fragments (same id, different validTimes) with the same gml:id.

Users can also create additional patterns for describing the temporal evolution of feature objects.

Further information on creating dynamic feature schemas and using GML temporal constructs can be found in the book GML Foundation for the GeoWeb (http://ca.wiley.com/WileyCDA/WileyTitle/productCd-0470871539.html).