Accessing images using time dimension.
Dave Weaver
dave.weaver at ZEN.CO.UK
Wed May 23 01:45:52 PDT 2007
On 18/05/07, Yewondwossen Assefa <assefa at dmsolutions.ca> wrote:
> Regarding the wms_time* parameters, they are only needed on the raster
> layer so the doc is good.
Ah ok. My mapfile has been adjusted appropriately (with no obvious effect).
> do you build mapserver yourself ? if that is the case, you could add
> the folowing lines at the end of function msWMSGetMap in mapwms.c
>
--- <snip> ---
Done.
> If the map is in debug mode and that the web element imagepath is set
> properly, this will generate the map resulting map file after all wms
> parameters are treated. This will allow you to see if/what is the
> FILTER element that is set re. your time request.
>
> Let me know, and If this helps and I will add this to mapserver repository.
Well it generated a map file (2 actually, identical apart from filename)
with a lot more information in it than my original. These are the relevant
layers from this bigger map file:
LAYER
METADATA
"wms_timeextent" "2007-01-01/2007-12-31"
"wms_timedefault" "2007-05-11T11:00:00Z"
"wms_title" "Satellite"
END
NAME "sat"
PROJECTION
"init=epsg:4326"
END
SIZEUNITS PIXELS
STATUS ON
TILEINDEX "time_idx"
TILEITEM "image_path"
TOLERANCEUNITS PIXELS
TYPE RASTER
UNITS METERS
END
LAYER
CONNECTION "dbname=map host=localhost"
CONNECTIONTYPE POSTGIS
DATA "the_geom from satellite using unique oid using srid = 4326"
METADATA
"wms_srs" "EPSG:4326"
"wms_timeitem" "image_time"
"wms_title" "time_index"
END
NAME "time_idx"
SIZEUNITS PIXELS
STATUS OFF
TOLERANCEUNITS PIXELS
TYPE POLYGON
UNITS METERS
END
As you can see there was no FILTER element anywhere.
I'm a bit stuck as to what to look at next...
To summarise where things are right now:
My relevant layers are defined thus:
LAYER
NAME "time_idx"
TYPE POLYGON
STATUS ON
# FILTER "(date_trunc('minute',image_time) = '2007-05-11T11:00:00')"
CONNECTIONTYPE POSTGIS
CONNECTION "dbname=map host=localhost"
DATA "the_geom from satellite using unique oid using srid = 4326"
METADATA
"wms_title" "time_index"
"wms_srs" "EPSG:4326"
"wms_timeitem" "image_time" #a column in postgis table of type
timestamp
END
END
LAYER
NAME "sat"
STATUS ON
TYPE RASTER
METADATA
"wms_title" "Satellite"
"wms_timeextent" "2007-01-01/2007-12-31"
"wms_timedefault" "2007-05-11T11:00:00Z"
END
PROJECTION
"init=epsg:4326"
END
TILEINDEX "time_idx" # Layer name containing time index
TILEITEM "image_path" # DB column containing path to image
END
There are 2 images in the satellite table:
map=> select image_path, image_time from satellite;
image_path | image_time
-----------------------------------------------------+---------------------
/home/map/fgs/www/htdocs/maps/images/sat2.tiff | 2007-05-11 11:00:00
/home/map/fgs/www/htdocs/maps/images/yesterday.tiff | 2007-05-11 10:00:00
(2 rows)
and my URL looks like this:
http://localhost:8080/cgi-bin/mapserv?map=/home/map/fgs/www/htdocs/maps/time.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=world,sat&WIDTH=800&HEIGHT=400&FORMAT=image/png&TRANSPARENT=false&BBOX=-90,-25,90,85&TIME=2007-05-11T11:00
However, despite both the TIME in the URL and the wms_timedefault values
showing 11:00, I can only ever see the 10:00 image
If I use this URL instead:
http://localhost:8080/cgi-bin/mapserv?map=/home/map/fgs/www/htdocs/maps/time.map&mode=map&layers=sat
And enable the FILTER line in the time_idx layer to select the 11:00 image,
I can see it. I just can't seem to get it working using a WMS request. Most
frustrating!
Dave.
More information about the MapServer-users
mailing list