[MapServer-users] TIME dimension as runtime substitution within DATA query?

Rahkonen Jukka jukka.rahkonen at maanmittauslaitos.fi
Thu Jun 20 04:19:28 PDT 2024


Hi,

What does not work for you in the WMS-T support as documented in WMS Time - MapServer 8.0.2 documentation<https://mapserver.org/ogc/wms_time.html>?

-Jukka Rahkonen-

Lähettäjä: MapServer-users <mapserver-users-bounces at lists.osgeo.org> Puolesta Marcin Niemyjski via MapServer-users
Lähetetty: torstai 20. kesäkuuta 2024 13.49
Vastaanottaja: Marcin Niemyjski via MapServer-users <mapserver-users at lists.osgeo.org>
Aihe: [MapServer-users] TIME dimension as runtime substitution within DATA query?

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/750bc604/attachment.htm>


More information about the MapServer-users mailing list