[mapserver-dev] could not load nexrad data
Bruce Clay
bclay1297 at gmail.com
Mon Nov 15 09:17:10 PST 2021
I am trying to pull nexrad data from mapserver to QGIS but it always fails
with the following error as reported in the mapsever error log
[Mon Nov 15 12:07:41 2021].244000 msDrawRasterLayerLow(nexrad_wmst):
entering.
[Mon Nov 15 12:07:41 2021].286000 msPostGISLayerWhichShapes(): Error
(ERROR: invalid input syntax for type timestamp:
"2021-11-15T10_49:39Z:00:00"
LINE 1: ... ("file_time" between date_trunc('hour',timestamp '2021-11-1...
^
) executing query: SELECT
"file_path"::text,"file_time"::text,ST_AsBinary(("geom"),'NDR') as
geom,"oid"::text FROM imagery.nexrad WHERE "geom" &&
ST_GeomFromText('POLYGON((-79.9499051833123
24.0232142857143,-79.9499051833123 49.9767857142857,-66.0213337547408
49.9767857142857,-66.0213337547408 24.0232142857143,-79.9499051833123
24.0232142857143))',find_srid('','imagery.nexrad','geom')) AND ("file_time"
between date_trunc('hour',timestamp '2021-11-15T10_49:39Z:00:00') and
date_trunc('hour',timestamp '2021-11-15T10_49:39Z:00:00') + interval '1
hour' - interval '1 second')
[Mon Nov 15 12:07:41 2021].286000 msPostGISLayerWhichShapes(): Query error.
Error executing query. Check server logs
[Mon Nov 15 12:07:41 2021].287000 msDrawMap(): Image handling error. Failed
to draw layer named 'nexrad_wmst'.
I followed the examples I could find on line as best I could. My map file
entries are as follows.
# Tile Index
LAYER
STATUS ON
NAME "time_idx"
TYPE POLYGON
DATA "geom from imagery.nexrad"
PROJECTION
"init=epsg:4326"
END
METADATA
"wms_title" "TIME INDEX"
"wms_srs" "EPSG:4326"
"wms_extent" "-126 24 -66 50"
"wms_timeextent" "2003-08-01/2006-12-31/PT5M"
"wms_timeitem" "file_time" #column in postgis table of type timestamp
"wms_timedefault" "2021-11-15T10_49:39Z"
"wms_enable_request" "*"
END
CONNECTIONTYPE postgis
CONNECTION "host=127.0.0.1 port=5433 dbname=weather user=postgres
password=<pwd>"
END
# raster layer
LAYER
NAME "nexrad_wmst"
TYPE RASTER
STATUS ON
DEBUG ON
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" "2021-11-14/2021-11-16/PT5M"
"wms_timeitem" "file_time" #datetime is a column in postgis table of
type timestamp
"wms_timedefault" "2021-11-15T10_49:39Z"
"wms_enable_request" "*"
END
OFFSITE 0 0 0
TILEITEM "file_path" #filepath is a column in postgis table with varchar
of the filepath to each image
TILEINDEX "time_idx"
FILTER (`[file_time]` = `2021-11-15 10:49:39`)
END
The data in the database looks like the following
station_id file_path timestamp min_lon min_lat max_lon max_lat
KMVX C:\data_dynamic\weather\ridge2_111521\KMVX_L3_BDHC_20211114_230548.tif
2021-11-14 23:07 -88.82200000 34.42055000 -78.82255000 44.42000000
I do not know where the time format shown in the error message comes from,
presumably from QGIS. the error occurs when try to add the nexrad data as
WMS.
The goal is to sequence through the NEXRAD images over time in QGIS.
Any thoughts would be greatly appreciated.
Bruce
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20211115/ae319177/attachment.html>
More information about the MapServer-dev
mailing list