[mapserver-users] MapFile DATA Syntax for PostGIS raster with FILTER

Lime, Steve D (MNIT) steve.lime at state.mn.us
Wed Feb 7 17:35:56 PST 2018


What version? You don’t have to use a filter. You can do it all in the data statement plus validation. —Steve
________________________________
From: mapserver-users <mapserver-users-bounces at lists.osgeo.org> on behalf of Paul Lewis <paul.lewis at igeotec.com>
Sent: Wednesday, February 7, 2018 11:13:23 AM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] MapFile DATA Syntax for PostGIS raster with FILTER

Does anyone have experience of the following issue that they could
possibly offer help or point me in the right direction
I'm trying to pass a dynamic filter to the mapfile but can't work out
the syntax to do so.
The context is having a web-application where I have a WMS layer in
Openlayers that connects to a Mapserver Mapfile which in turn is reading
from a PostGIS raster DB, all latest versions available on a base Ubuntu
16.04 server.
In a vector PostGIS DB case a layer can be configured to have a dynamic
client-side filter through the following base syntax, which is fine and
works for vector tables in the DB:

DATA "geom FROM some_table using unique id using srid=4326"
FILTER (id = '%id%')

As I understand it this in effect this generates an SQL statement where
the FILTER is created as a where clause in the DATA SQL.

However, in a raster DB example the DATA syntax shown at this link
[http://postgis.net/docs/RT_FAQ.html#idm28328] is as follows:

DATA "PG:host=localhost port=5432 dbname='some_db' user='some_user'
password='some_password' schema='some_schema' table='some_table'
where='id=12' mode='2' "

So I can get things to work with hardcoded where elements, i.e. id=12
but in the previous example I could set the id parameter dynamically in
the Openlayers WMS query through the FILTER line.
Does anyone know the syntax to achieve this in the above type of raster
DATA example or is it even possible?

Thanks
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20180208/f036cedd/attachment.html>


More information about the mapserver-users mailing list