<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body>
What version? You don’t have to use a filter. You can do it all in the data statement plus validation. —Steve
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> mapserver-users <mapserver-users-bounces@lists.osgeo.org> on behalf of Paul Lewis <paul.lewis@igeotec.com><br>
<b>Sent:</b> Wednesday, February 7, 2018 11:13:23 AM<br>
<b>To:</b> mapserver-users@lists.osgeo.org<br>
<b>Subject:</b> [mapserver-users] MapFile DATA Syntax for PostGIS raster with FILTER</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Does anyone have experience of the following issue that they could
<br>
possibly offer help or point me in the right direction<br>
I'm trying to pass a dynamic filter to the mapfile but can't work out <br>
the syntax to do so.<br>
The context is having a web-application where I have a WMS layer in <br>
Openlayers that connects to a Mapserver Mapfile which in turn is reading <br>
from a PostGIS raster DB, all latest versions available on a base Ubuntu <br>
16.04 server.<br>
In a vector PostGIS DB case a layer can be configured to have a dynamic <br>
client-side filter through the following base syntax, which is fine and <br>
works for vector tables in the DB:<br>
<br>
DATA "geom FROM some_table using unique id using srid=4326"<br>
FILTER (id = '%id%')<br>
<br>
As I understand it this in effect this generates an SQL statement where <br>
the FILTER is created as a where clause in the DATA SQL.<br>
<br>
However, in a raster DB example the DATA syntax shown at this link <br>
[<a href="http://postgis.net/docs/RT_FAQ.html#idm28328">http://postgis.net/docs/RT_FAQ.html#idm28328</a>] is as follows:<br>
<br>
DATA "PG:host=localhost port=5432 dbname='some_db' user='some_user' <br>
password='some_password' schema='some_schema' table='some_table' <br>
where='id=12' mode='2' "<br>
<br>
So I can get things to work with hardcoded where elements, i.e. id=12 <br>
but in the previous example I could set the id parameter dynamically in <br>
the Openlayers WMS query through the FILTER line.<br>
Does anyone know the syntax to achieve this in the above type of raster <br>
DATA example or is it even possible?<br>
<br>
Thanks<br>
_______________________________________________<br>
mapserver-users mailing list<br>
mapserver-users@lists.osgeo.org<br>
<a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a></div>
</span></font></div>
</body>
</html>