Postgis syntax error with WMS time request
Dave Weaver
dave.weaver at ZEN.CO.UK
Wed Jun 13 01:36:11 PDT 2007
A couple of weeks ago I experimented with the WMS time support in Mapserver,
and got a simple example going on one machine.
Now I am trying to implement time support on a different machine (using the
mapserv from the fgs distribution), but I am getting a strange error I don't
fully understand:
------------------------------------
msDrawMap(): Image handling error. Failed to draw layer named 'sat_time_idx'.
prepare_database(): Query error. Error executing POSTGIS DECLARE (the actual
query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT
image_time::text,asbinary(force_collection(force_2d(geometry)),'NDR'),image_path::text
from satellite WHERE (image_time = 'date_trunc('minute', image_time) =
'2007-06-12T11:00:00'') and (geometry && setSRID( 'BOX3D(-20012461.4573608
-44133305.4068053,20012461.4573608
44133305.4068064)'::BOX3D,find_srid('','satellite','geometry') ))'
Postgresql reports the error as 'ERROR: syntax error at or near "minute" at
character 178
------------------------------------
I can see what the syntax error is, but I've no idea why it's happening! Can
anyone help?
The URL I'm using, if it helps, is:
http://pb-vmap2:8080/cgi-bin/mapserv?map=map/satellite.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=satellite&SRS=EPSG:4326&BBOX=-180,-90,180,90&WIDTH=800&HEIGHT=400&FORMAT=image/png&TRANSPARENT=false&TIME=2007-06-12T11:00
My map file is as follows:
MAP
NAME "Satellite"
STATUS ON
EXTENT -20037508.34 -20037508.34 20037508.34 20037508.34
SIZE 800 400
SHAPEPATH "/home/map/shapes"
IMAGECOLOR 100 100 200
TRANSPARENT ON
WEB
IMAGEPATH "/home/map/fgs/tmp/ms_tmp/"
IMAGEURL "/ms_tmp/"
METADATA
"wms_title" "Satellite"
"wms_onlineresource"
"http://pb-vmap2:8080/cgi-bin/mapserv.exe?map=satellite.map"
"wms_srs" "EPSG:4326 EPSG:54004"
END
END
PROJECTION
"init=epsg:54004"
END
OUTPUTFORMAT
NAME PNG24
DRIVER "GD/PNG"
MIMETYPE "image/png"
EXTENSION PNG
IMAGEMODE RGBA
END
LAYER
NAME "sat_time_idx"
TYPE POLYGON
STATUS DEFAULT
CONNECTIONTYPE POSTGIS
CONNECTION "dbname=map" # host=localhost"
DATA "geometry from satellite using unique image_path using srid
= 4326"
METADATA
"wms_title" "sat_time_idx"
"wms_srs" "EPSG:4326 EPSG:54004"
"wms_timeitem" "image_time" #a column in postgis table of type timestamp
"wms_timeextent" "2007-01-01/2099-12-31"
"wms_timedefault" "2007-06-12T08:00:00Z"
END
END
LAYER
NAME satellite
TYPE RASTER
STATUS ON
METADATA
"wms_title" "satellite"
"wms_srs" "EPSG:4326 EPSG:54004"
END
TRANSPARENCY 60
TILEINDEX "sat_time_idx"
TILEITEM "image_path"
PROJECTION
"init=epsg:4326"
END
END
END
Many Thanks,
Dave.
More information about the MapServer-users
mailing list