[mapserver-users] Mapserver doesn't send good filter to postgis

Steve.Toutant at inspq.qc.ca Steve.Toutant at inspq.qc.ca
Mon Jan 26 06:54:54 PST 2015


Sorry my first post was with an inapprpriate title......

I'm using mapserver 6.4.1 and postgis 2.1

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...

The wfs POST Request (created and send by OpenLayers client)
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc
"><ogc:Within><ogc:PropertyName>msGeometry</ogc:PropertyName><gml:Polygon 
xmlns:gml="http://www.opengis.net/gml" 
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> 


In Mapserver log, I see
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))'))

Then a few lines later, I see that it is not sending the polygon received 
as filter
select .......  where geom_p && ST_GeomFromText('POLYGON((-9239517 
5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 
5465442))',3857);

See the polygon definition is different, postgis receive the extent 
defined in the mapfile
EXTENT -9239517 5465442 -5565974 9349764


And, in postgis log I see this query, See the
select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 
5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 
5465442))',3857);


Why Mapserver is not sending the polygon received as filter to postgis?


Thanks!

Steve Toutant, M. Sc.
Analyste en géomatique
Secteur environnement
Direction de la santé environnementale et de la toxicologie
Institut national de santé publique du Québec
Tél.: 418 646-6777 poste 30015
Téléc.: 418 644-4593
steve.toutant at inspq.qc.ca
http://www.inspq.qc.ca
http://www.monclimatmasante.qc.ca 
Pour me rejoindre par courrier
Service de l'infrastructure et du réseau
Direction des technologies de l'information
Ministère de la Sécurité Publique
2525 boul. Laurier, 2e étage
Tour Laurentides
Québec, G1V 2L2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150126/acb8c8c3/attachment.html>


More information about the mapserver-users mailing list