[MapServer-users] TIME dimension as runtime substitution within DATA query?
Marcin Niemyjski
mniemyjski at cloudferro.com
Thu Jun 20 03:48:52 PDT 2024
Hello
Is it possible to use the TIME dimension as a parameter for runtime substitution?
What I'm trying to achieve: I want to limit the rows in the database query by applying a date within the query itself. Specifically, I need to use the TIME dimension instead of custom parameters like start_date and stop_date to ensure full compatibility with the OGC WMS-T standard.
There is also the issue of parsing the TIME value into a format acceptable by the query. However, for now, let's assume that I'm providing a single date within TIME.
LAYER
DEBUG 5
STATUS OFF
NAME "stac_query"
TYPE POLYGON
CONNECTIONTYPE postgis
CONNECTION "***"
DATA "geometry from ... WHERE datetime >= %TIME% AND datetime <%TIME% AND (id = ANY ('{%pid%}') or '%pid%' = '-1' AND collection = ANY ('{cryo-demo}') ) ORDER BY datetime DESC, id DESC) as subquerry using unique id using srid=4326"
PROJECTION
"init=epsg:4326"
END
VALIDATION
'pid' '^.{2,37}$'
'asset' '^.{3,6}$'
'default_pid' '-1'
'default_asset' '-1'
END
METADATA
"wms_srs" "EPSG:3857 EPSG:4326 EPSG:2180"
"wms_title" "stac_query"
"wms_timeextent" "2015-01-01/2025-01-01/P1D"
"wms_timeitem" "datetime"
"wms_timedefault" "2024-04-08"
"wms_enable_request" "!*"
END
PROCESSING "CLOSE_CONNECTION=DEFER"
END
Any clue?
Best,
Marcin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20240620/f90e26b8/attachment.htm>
More information about the MapServer-users
mailing list