<font size=2 face="sans-serif">sorry I'm confused, perhaps I misunderstand
what you explained. I don't understand what you mean by</font><font size=3 color=#004080 face="Calibri">
"MapServer does use the supplied geometry, it’s a matter of where
the filter is applied – the database or in MapServer"</font>
<br>
<br><font size=2 face="sans-serif">In mapserver log I see </font>
<p><font size=3 face="Arial">FLTLayerApplyPlainFilterToLayer(): ([shape]
within fromText('POLYGON ((-8081644.2511243997141719 5835062.5699599999934435,
-8081707.5505384001880884 5834980.1612889003008604, -8081638.2794815003871918
5834913.2788891997188330, -8081533.1785677000880241 5834988.5215889001265168,
-8081644.2511243997141719 5835062.5699599999934435))'))</font><font size=3 face="Times New Roman">
</font><font size=3 face="Arial"><br>
</font>
<p><font size=3 face="Arial">So this is good, but<br>
A few lines later in the mapserver log, I see that it is not sending the
supplied geometry as filter, it is sending the extent of the mapfile<br>
select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517
5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 5465442))',3857);</font>
<br>
<br><font size=2 face="sans-serif">So it received the supplied geometry,
but it is not using it....</font>
<br>
<br><font size=2 face="sans-serif">If only BBOX can be used as a spatial
operator, it is not good for our needs. We really need to know what features
are inside a user defined polygon.</font>
<br>
<br>
<p>
<p>
<br>
<br>
<br>
<table width=100% style="border-collapse:collapse;">
<tr valign=top height=8>
<td width=40% style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size=1 face="sans-serif"><b>"Lime,
Steve D (MNIT)" <Steve.Lime@state.mn.us></b> </font>
<p><font size=1 face="sans-serif">2015-01-26 10:56</font>
<td width=59% style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;">
<table width=100% style="border-collapse:collapse;">
<tr valign=top height=21>
<td width=57 style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;">
<div align=right><font size=1 face="sans-serif">A</font></div>
<td style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size=1 face="sans-serif">"Steve.Toutant@inspq.qc.ca"
<Steve.Toutant@inspq.qc.ca></font>
<tr valign=top height=21>
<td width=57 style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;">
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size=1 face="sans-serif">"mapserver-users@lists.osgeo.org"
<mapserver-users@lists.osgeo.org></font>
<tr valign=top height=21>
<td width=57 style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;">
<div align=right><font size=1 face="sans-serif">Objet</font></div>
<td style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size=1 face="sans-serif">RE:
[mapserver-users] Mapserver doesn't send good filter to postgis</font></table>
<br>
<table width=393 style="border-collapse:collapse;">
<tr valign=top height=8>
<td width=57 style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;">
<td width=336 style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"></table>
<br></table>
<br>
<br>
<br>
<br>
<br><font size=3 color=#004080 face="Calibri">MapServer does use the supplied
geometry, it’s a matter of where the filter is applied – the database
or in MapServer. This isn’t a new limitation so others may have more experience
with workarounds. Maybe try also setting a bbox in the filter based on
the bbox of the geometry? </font>
<br><font size=3 color=#004080 face="Calibri"> </font>
<br><font size=3 color=#004080 face="Calibri">Steve</font>
<br><font size=3 color=#004080 face="Calibri"> </font>
<br><font size=3 face="Tahoma"><b>From:</b> Steve.Toutant@inspq.qc.ca [</font><a href=mailto:Steve.Toutant@inspq.qc.ca><font size=3 face="Tahoma">mailto:Steve.Toutant@inspq.qc.ca</font></a><font size=3 face="Tahoma">]
<b><br>
Sent:</b> Monday, January 26, 2015 9:38 AM<b><br>
To:</b> Lime, Steve D (MNIT)<b><br>
Cc:</b> mapserver-users@lists.osgeo.org<b><br>
Subject:</b> RE: [mapserver-users] Mapserver doesn't send good filter to
postgis</font>
<br><font size=3 face="Times New Roman"> </font>
<p><font size=3 face="Arial">I understand the objective of rfc 91, but
the most common use case would be to pass the supplied geometry.....</font><font size=3 face="Times New Roman">
</font>
<p><font size=3 face="Arial">If mapserver doesn't use the supplied geometry,
that means that it doesn't support spatial filtering. </font>
<p><font size=3 face="Arial">Our data covers the whole country, not using
the supplied geometry means we can't use mapserver as a wfs server....</font><font size=3 face="Times New Roman">
</font>
<p><font size=3 face="Arial">Is there something we can do about it? A workaround
we could use?</font><font size=3 face="Times New Roman"> </font>
<p><font size=3 face="Times New Roman"><br>
</font>
<p>
<table width=100% style="border-collapse:collapse;">
<tr valign=top height=8>
<td width=31% style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size=3 face="Arial"><b>"Lime,
Steve D (MNIT)" <</b></font><a href=mailto:Steve.Lime@state.mn.us><font size=3 color=blue face="Arial"><b><u>Steve.Lime@state.mn.us</u></b></font></a><font size=3 face="Arial"><b>></b>
</font>
<p><font size=3 face="Arial">2015-01-26 10:14</font><font size=3 face="Times New Roman">
</font>
<td width=68% style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;">
<br>
<table width=100% style="border-collapse:collapse;">
<tr valign=top height=8>
<td width=7% style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;">
<div align=right><font size=3 face="Arial">A</font></div>
<td width=92% style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size=3 face="Arial">"</font><a href=mailto:Steve.Toutant@inspq.qc.ca><font size=3 color=blue face="Arial"><u>Steve.Toutant@inspq.qc.ca</u></font></a><font size=3 face="Arial">"
<</font><a href=mailto:Steve.Toutant@inspq.qc.ca><font size=3 color=blue face="Arial"><u>Steve.Toutant@inspq.qc.ca</u></font></a><font size=3 face="Arial">>,
"</font><a href="mailto:mapserver-users@lists.osgeo.org"><font size=3 color=blue face="Arial"><u>mapserver-users@lists.osgeo.org</u></font></a><font size=3 face="Arial">"
<</font><a href="mailto:mapserver-users@lists.osgeo.org"><font size=3 color=blue face="Arial"><u>mapserver-users@lists.osgeo.org</u></font></a><font size=3 face="Arial">></font><font size=3 face="Times New Roman">
</font>
<tr valign=top height=8>
<td style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;">
<div align=right><font size=3 face="Arial">cc</font></div>
<td style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;">
<tr valign=top height=8>
<td style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;">
<div align=right><font size=3 face="Arial">Objet</font></div>
<td style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size=3 face="Arial">RE:
[mapserver-users] Mapserver doesn't send good filter to postgis</font></table>
<br><font size=3 face="Times New Roman"> </font>
<p>
<br>
<table width=393 style="border-collapse:collapse;">
<tr valign=top height=8>
<td width=57 style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;">
<td width=336 style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"></table>
<br></table>
<p><font size=3 face="Times New Roman"><br>
<br>
<br>
<br>
</font><font size=3 color=#004080 face="Calibri"><br>
It’s a limitation in older versions of MapServer where specific backend
optimizations were scattered about the WMS/WFS code. Most of those optimizations
address the most common use cases – I guess this wasn’t one of them.
It’s surprising that at worst the extent of the supplied geometry isn’t
passed (I see a comment in the WFS code about this). The specific filter
intersection test is applied on the MapServer side – the results are correct,
performance can suffer though.</font><font size=3 face="Times New Roman">
</font><font size=3 color=#004080 face="Calibri"><br>
</font><font size=3 face="Times New Roman"> </font><font size=3 color=#004080 face="Calibri"><br>
This is being addresses in MapServer 7.0 where more complete filter translation
functions are being supported (RFC 91).</font><font size=3 face="Times New Roman">
</font><font size=3 color=#004080 face="Calibri"><br>
</font><font size=3 face="Times New Roman"> </font><font size=3 color=#004080 face="Calibri"><br>
Steve</font><font size=3 face="Times New Roman"> </font><font size=3 color=#004080 face="Calibri"><br>
</font><font size=3 face="Times New Roman"> </font><font size=3 face="Tahoma"><b><br>
From:</b> </font><a href="mailto:mapserver-users-bounces@lists.osgeo.org"><font size=3 color=blue face="Tahoma"><u>mapserver-users-bounces@lists.osgeo.org</u></font></a><font size=3 face="Tahoma">
[</font><a href="mailto:mapserver-users-bounces@lists.osgeo.org"><font size=3 color=blue face="Tahoma"><u>mailto:mapserver-users-bounces@lists.osgeo.org</u></font></a><font size=3 face="Tahoma">]
<b>On Behalf Of </b></font><a href=mailto:Steve.Toutant@inspq.qc.ca><font size=3 color=blue face="Tahoma"><u>Steve.Toutant@inspq.qc.ca</u></font></a><font size=3 face="Tahoma"><b><br>
Sent:</b> Monday, January 26, 2015 8:55 AM<b><br>
To:</b> </font><a href="mailto:mapserver-users@lists.osgeo.org"><font size=3 color=blue face="Tahoma"><u>mapserver-users@lists.osgeo.org</u></font></a><font size=3 face="Tahoma"><b><br>
Subject:</b> [mapserver-users] Mapserver doesn't send good filter to postgis</font><font size=3 face="Times New Roman">
<br>
</font><font size=3 face="Arial"><br>
Sorry my first post was with an inapprpriate title......</font><font size=3 face="Times New Roman">
</font><font size=3 face="Arial"><br>
<br>
I'm using mapserver 6.4.1 and postgis 2.1</font><font size=3 face="Times New Roman">
</font><font size=3 face="Arial"><br>
<br>
using OpenLayers 2.13.1 I draw a small polygon that I use for a within
spatial filter of a WFS getfeature request. The problem is that mapserver
is not sending this polygon to postgis, it is sending the extent of the
mapfile as filter...</font><font size=3 face="Times New Roman"> </font><font size=3 face="Arial"><br>
<br>
The wfs POST Request (created and send by OpenLayers client)</font><font size=3 face="Times New Roman">
</font><font size=3 color=#2f2f2f face="DejaVu Sans Mono"><br>
<ogc:Filter xmlns:ogc="</font><a href=http://www.opengis.net/ogc><font size=3 color=blue face="DejaVu Sans Mono"><u>http://www.opengis.net/ogc</u></font></a><font size=3 color=#2f2f2f face="DejaVu Sans Mono">"><ogc:Within><ogc:PropertyName>msGeometry</ogc:PropertyName><gml:Polygon
xmlns:gml="</font><a href=http://www.opengis.net/gml><font size=3 color=blue face="DejaVu Sans Mono"><u>http://www.opengis.net/gml</u></font></a><font size=3 color=#2f2f2f face="DejaVu Sans Mono">"
srsName="urn:ogc:def:crs:EPSG::3857"><gml:exterior><gml:LinearRing><gml:posList>-8081644.2511244
5835062.56996 -8081707.5505384 5834980.1612889 -8081638.2794815 5834913.2788892
-8081533.1785677 5834988.5215889 -8081644.2511244 5835062.56996</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></ogc:Within></ogc:Filter></font><font size=3 face="Times New Roman">
</font><font size=3 face="Arial"><br>
<br>
In Mapserver log, I see</font><font size=3 face="Times New Roman"> </font><font size=3 face="Arial"><br>
FLTLayerApplyPlainFilterToLayer(): ([shape] within fromText('POLYGON
((-8081644.2511243997141719 5835062.5699599999934435, -8081707.5505384001880884
5834980.1612889003008604, -8081638.2794815003871918 5834913.2788891997188330,
-8081533.1785677000880241 5834988.5215889001265168, -8081644.2511243997141719
5835062.5699599999934435))'))</font><font size=3 face="Times New Roman">
</font><font size=3 face="Arial"><br>
<br>
Then a few lines later, I see that it is not sending the polygon received
as filter</font><font size=3 face="Times New Roman"> </font><font size=3 face="Arial"><br>
select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517
5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 5465442))',3857);</font><font size=3 face="Times New Roman">
</font><font size=3 face="Arial"><br>
<br>
See the polygon definition is different, postgis receive the extent defined
in the mapfile</font><font size=3 face="Times New Roman"> </font><font size=3 face="Arial"><br>
EXTENT -9239517 5465442 -5565974 9349764</font><font size=3 face="Times New Roman">
<br>
</font><font size=3 face="Arial"><br>
<br>
And, in postgis log I see this query, See the</font><font size=3 face="Times New Roman">
</font><font size=3 face="Arial"><br>
select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517
5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 5465442))',3857);</font><font size=3 face="Times New Roman">
<br>
</font><font size=3 face="Arial"><br>
<br>
Why Mapserver is not sending the polygon received as filter to postgis?</font><font size=3 face="Times New Roman">
<br>
</font><font size=3 face="Arial"><br>
<br>
Thanks!</font><font size=3 face="Times New Roman"> </font>
<p><font size=3 color=#0080ff face="Times New Roman"><i>Steve Toutant,
M. Sc.</i></font><font size=3 face="Times New Roman"><br>
Analyste en géomatique<br>
Secteur environnement<br>
Direction de la santé environnementale et de la toxicologie<br>
Institut national de santé publique du Québec<br>
Tél.: 418 646-6777 poste 30015<br>
Téléc.: 418 644-4593</font><font size=3 color=blue face="Times New Roman"><u><br>
</u></font><a href=mailto:steve.toutant@inspq.qc.ca><font size=3 color=blue face="Times New Roman"><u>steve.toutant@inspq.qc.ca</u></font></a><font size=3 color=blue face="Times New Roman"><u><br>
</u></font><a href=http://www.inspq.qc.ca/><font size=3 color=blue face="Times New Roman"><u>http://www.inspq.qc.ca</u></font></a><font size=3 color=blue face="Times New Roman"><u><br>
</u></font><a href=http://www.monclimatmasante.qc.ca/><font size=3 color=blue face="Times New Roman"><u>http://www.monclimatmasante.qc.ca</u></font></a><font size=3 face="Times New Roman">
</font>
<p><font size=3 face="Times New Roman"><i>Pour me rejoindre par courrier</i><br>
Service de l'infrastructure et du réseau<br>
Direction des technologies de l'information<br>
Ministère de la Sécurité Publique<br>
2525 boul. Laurier, 2e étage<br>
Tour Laurentides<br>
Québec, G1V 2L2 <br>
</font>
<br>
<br>
<br>