Author: | Jeff McKenna |
---|---|
Contact: | jmckenna at gatewaygeomatics.com |
Revision: | $Revision: 8295 $ |
Date: | $Date: 2008-12-26 21:08:04 -0800 (Fri, 26 Dec 2008) $ |
Last Updated: | 2006/06/26 |
Table of Contents
A WMS server can provide support to temporal requests. This is done by providing a TIME parameter with a time value in the request. MapServer 4.4 and above provides support to interpret the TIME parameter and transform the resulting values into appropriate requests.
WMS specifies that the basic format used for TIME requests is based on the ISO 8601:1988(E) “extended” format. MapServer supports a limited set of patterns that are defined in the ISO 8601 specifications, as well as few other patterns that are useful but not compliant to ISO 8601. Here is a list of patterns currently supported:
Table 1. Supported Time Patterns
Time Patterns | Examples |
---|---|
YYYYMMDD | 20041012 |
YYYY-MM-DDTHH:MM:SSZ | 2004-10-12T13:55:20Z |
YYYY-MM-DDTHH:MM:SS | 2004-10-12T13:55:20 |
YYYY-MM-DD HH:MM:SS | 2004-10-12 13:55:20 |
YYYY-MM-DDTHH:MM | 2004-10-12T13:55 |
YYYY-MM-DD HH:MM | 2004-10-12 13:55 |
YYYY-MM-DDTHH | 2004-10-12T13 |
YYYY-MM-DD HH | 2004-10-12 13 |
YYYY-MM-DD | 2004-10-12 |
YYYY-MM | 2004-10 |
YYYY | 2004 |
THH:MM:SSZ | T13:55:20Z |
THH:MM:SS | T13:55:20 |
To have a valid WMS layer with time support, the user has to define the following metadata at the layer level:
Time Extents can be declared with the following syntax for the wms_timeextent metadata (see Annex C.3 in the WMS 1.1.1 specification document for a full description):
LAYER
NAME "earthquakes"
METADATA
"wms_title" "Earthquakes"
"wms_timeextent" "2004-01-01/2004-02-01"
"wms_timeitem" "TIME"
"wms_timedefault" "2004-01-01 14:10:00"
END
TYPE POINT
STATUS ON
DATA "quakes"
CLASS
..
END
END
If your layer is set up properly, requesting the capabilities on the server outputs a Dimension element. Here is an example of a GetCapabilities result for a layer configured for time support:
<Layer queryable="0" opaque="0" cascaded="0">
<Name>earthquakes</Name>
<Title>Earthquakes</Title>
<SRS>EPSG:4326</SRS>
<LatLonBoundingBox minx="-131.02" miny="24.84" maxx="-66.59" maxy="48.39" />
<BoundingBox SRS="EPSG:4326"
minx="-131.02" miny="24.84" maxx="-66.59" maxy="48.39" />
<Dimension name="time" units="ISO8601"/>
<Extent name="time" default="2004-01-01 14:10:00" nearestValue="0">2004-01-01/2004-02-01</Extent>
</Layer>
When sending a request with the TIME parameter, different types of time values can be specified. The following are supported by MapServer:
When MapServer receives a request with a TIME parameter, it transforms the time requests into valid expressions that are assigned to the filter parameter on layers that are time-aware. Here are some examples of how different types of requests are treated (wms_timeitem is defined here as being “time_field”):
As shown in the above examples, all fields and values are written inside back tics (`) - this is the general way of specifying time expressions inside MapServer.
Exceptions to this rule:
The user has the ability to define the time format(s) to be used when a request is sent, in metadata at the WEB level. For example, the user can define the following two formats:
"wms_timeformat" "YYYY-MM-DDTHH, YYYY-MM-DDTHH:MM"
Another example is for a WMS layer that is based on time data that contains precise time values taken every minute (e.g., 2004-10-12T13:55, 2004-10-12T13:56, 2004-10-12 T13:57, ...). Normally, a valid request on such a layer would require the time value to be as complete as the data underneath. By defining a set of patterns to use, MapServer introduces the notion of resolution to be used when doing a query. Using the example above, a request TIME= 2004-10-12T13:55 would be valid and a request TIME= 2004-10-12T13 would also be valid and would return all elements taken for that hour.
Note that this functionality is only available on layers based on Shapefiles and OGR.
This example currently requires latest 4.9 CVS build!
Here is an example mapfile snippet for a raster WMS-T instance using a PostGIS tileindex. This example shows US Nexrad Base Reflectivity running at Iowa State U at http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?SERVICE=WMS&request=GetCapabilities
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | # Tile Index
LAYER
STATUS ON
NAME "time_idx"
TYPE POLYGON
DATA "the_geom from nexrad_n0r_tindex"
METADATA
"wms_title" "TIME INDEX"
"wms_srs" "EPSG:4326"
"wms_extent" "-126 24 -66 50"
"wms_timeextent" "2003-08-01/2006-12-31/P5M"
"wms_timeitem" "datetime" #column in postgis table of type timestamp
"wms_timedefault" "2006-06-23T03:10:00Z"
END
CONNECTION "dbname=postgis host=10.10.10.20"
CONNECTIONTYPE postgis
END
# raster layer
LAYER
NAME "nexrad-n0r-wmst"
TYPE RASTER
STATUS ON
DEBUG ON
DUMP TRUE
PROJECTION
"init=epsg:4326"
END
METADATA
"wms_title" "NEXRAD BASE REF WMS-T"
"wms_srs" "EPSG:4326"
"wms_extent" "-126 24 -66 50"
"wms_timeextent" "2003-08-01/2006-12-31/P5M"
"wms_timeitem" "datetime" #datetime is a column in postgis table of type timestamp
"wms_timedefault" "2006-06-23T03:10:00Z"
END
OFFSITE 0 0 0
TILEITEM "filepath" #filepath is a column in postgis table with varchar of the filepath to each image
TILEINDEX "time_idx"
END
|
You can find more information on Time and tileindexes in the WCS documentation.