Time support with filenames only ?

Eric Bridger eric at GOMOOS.ORG
Wed Dec 29 11:34:22 EST 2004


On Wed, 2004-12-29 at 10:30, Marco Marsella wrote:
> Hi,
>
> we are trying out MapServer and it looks great! However, we plan to serve a lot of time-dependent
> raster layers (satellite images) both through WMS and WCS. Our images are store in files where the
> date is part of the filename (e.g. 2004-12-23.tif or similar). My understanding is that we need
> either a DB or a shapefile to index the time values. Is that right ?
>
> If this is true, this would be an inconvenience because each time we get a new image (and some
> are received every 30 minutes) we would have to update the DB or the shapefile. What about some
> way to use tokens in filenames ?
>
> For instance, we could write something like:
>
> LAYER
>     NAME "meteosat"
>     TYPE RASTER
>     DATA "%YY%-%MM%-%DD%.tif"
>     FILTER "%time%"
> END
>
> The idea being that the time filter item is automatically parsed in its components whose values are
> placed in the %YY%, %MM%, %DD% (and %HH%, %MI%, %SS% if present) tokens that are then plugged
> into the filename template provided by DATA to obtain the final filename to get.
>
> This would be a considerable simplification would it not ?

When you pass additional parameters to a Mapserver based WMS or WCS
service there are no "rules" on what format they can be. Any query
string name=value pair will be substituted into most (not all) %name%
tags found in the map file.

So you can insist that your users pass: time=YY-MM-DD and in your map
file use:
DATA "%time%.tif"

Or you could require year=YY&month=MM&day=DD and use %year%, %month%,
etc.

For a raster layer FILTER "%time%" would have not affect anyway.

Eric



More information about the mapserver-users mailing list