Using WMS time dimension with rasters?

Jeff de La Beaujardiere jeff2005 at SVS.GSFC.NASA.GOV
Wed Oct 12 12:52:29 EDT 2005


Eric Bridger <eric at GOMOOS.ORG> wrote:
 > Alternatively, you can use Mapserver's variable substituion.
 > See: http://mapserver.gis.umn.edu/doc46/mapfile-reference.html#variablesubstitution
 > If you store your rasters with a time stamp as part of the name e.g.
 > modis_YYYYMMDDTHHMM.jpg, you can use the following in your map file:
 > DATA '/modis_files/%time%.jpg'

I have noticed a couple of problems (or undocumented limitations, at any rate),
with the otherwise-useful variable substitution mechanism. Unless I'm missing
something,

(1) no substitution occurs in TILEINDEX entries in the mapfile.
Example: the following substitution works perfectly
  DATA "/home/delabeau/wms/data/goes/%year%/%month%/%day%/%file%"
but this one
  TILEINDEX "/home/delabeau/wms/data/modis/tc/%year%/%month%/%day%/%file%"
complains
  msSHPOpenFile(): Unable to access file. (/home/delabeau/wms/data/modis/tc/%year%/%month%/%day%/%file%)

I think the problem is in mapserv.c after line 281 (v4.6.1), where data,
connection, filter and class are explicitly considered but tileitem is ignored.

(2) It seems that the entire filename must be substituted, not just part:
i.e, %file% works for me but %file%.tif does not.

My GOES server has a single GeoTIFF for each full-disk image, so it uses
a DATA statement and problem #1 is not an issue.
http://map05.gsfc.nasa.gov/cgi-bin/goes?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities

However, my MODIS Atlantic hurricane server creates a daily composite of individual granules using
a TILEINDEX, so problem #1 causes me grief.  I work around it by having my CGI
front-end parse the TIME parameter and determine the appropriate date-specific
layer name (e.g., 'layers=modis&time=2005-10-10' becomes 'layers=modis20051010'
before Mapserv is called).
http://map05.gsfc.nasa.gov/cgi-bin/modis?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities

 > Your users would then need to add the &time=YYYYMMDDTHHMM parameter
 > to their GetMap requests.

Note that for OGC WMS, the punctuated form of ISO 8601 time is required:
time=yyyy-dd-ddThh:mm.

Regards,
Jeff DLB

* All opinions my own, not my employer's. *



More information about the mapserver-users mailing list