<font size=2 face="sans-serif">Try adding </font><font size=3 color=#2f2f2f face="Liberation Mono">&srsName="EPSG:4326"
as a parameter</font>
<br><font size=1 face="Arial">typeName=SampleLayer</font><font size=3 color=#2f2f2f face="Liberation Mono">&srsName=EPSG:4326</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">De :
</font><font size=1 face="sans-serif">Kajod Sharma <kajod4u@yahoo.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">A :
</font><font size=1 face="sans-serif">"mapserver-users@lists.osgeo.org"
<mapserver-users@lists.osgeo.org></font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date :
</font><font size=1 face="sans-serif">2017-04-26 09:43</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Objet :
</font><font size=1 face="sans-serif">[mapserver-users]
Issue in using MapServer WFS Filter</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Envoyé par :
</font><font size=1 face="sans-serif">"mapserver-users"
<mapserver-users-bounces@lists.osgeo.org></font>
<br>
<hr noshade>
<br>
<br>
<br><font size=2 face="Arial">Hi,</font>
<br>
<br><font size=2 face="Arial">Greetings!</font>
<br>
<br><font size=2 face="Arial">I hope this is a right platform to discuss
my query regarding FILTER applied on MapServer WFS.</font>
<br>
<br><font size=2 face="Arial">I'm new in this area and exploring some features
of MapServer. I want to use GetFeature request of WFS to get features applied
on any location on map. I'm using "MapServer version 7.0.4 (MS4W 3.2.1)"
and trying to apply filter "Contains" for it.</font>
<br>
<br><font size=2 face="Arial">I can see two problems when it applies Filter
query on PostGIS:</font>
<br>
<br><font size=2 color=#e01f25 face="Arial">1. It looks it adds an extra
default geospatial filter in it while making a query to PostGIS. This default
spatial filter is not stopping to return any result from PostGIS. Is there
any way to exclude this default filter?</font>
<br><font size=2 color=#40005f face="Arial">2. It seems Contains coordinates
are not transformed properly according to SRS of data in PostGIS.</font>
<br>
<br><font size=2 face="Arial">I've tries with different projection in map
file and request message with no success.</font>
<br>
<br><font size=2 face="Arial">Supporting data to give your input on my
queries:</font>
<br>
<br><font size=2 face="Arial">WFS request</font>
<br><font size=2 face="Arial">*************************</font>
<br><font size=2 face="Arial">Formatted Version:</font>
<br>
<br><a href="http://localhost/cgi-bin/mapserv.exe?"><font size=1 face="Arial">http://localhost/cgi-bin/mapserv.exe?</font></a><font size=1 face="Arial"><br>
service=WFS&<br>
map=C:/Data/MapServerWFSSample.map&<br>
request=GetFeature&<br>
version=2.0.0&<br>
typeName=SampleLayer&<br>
FILTER=<Filter xmlns="</font><a href=http://www.opengis.net/ogc><font size=1 face="Arial">http://www.opengis.net/ogc</font></a><font size=1 face="Arial">"
xmlns:gml="</font><a href=http://www.opengis.net/gml><font size=1 face="Arial">http://www.opengis.net/gml</font></a><font size=1 face="Arial">"
xmlns:ms="</font><a href=http://mapserver.gis.umn.edu/mapserver><font size=1 face="Arial">http://mapserver.gis.umn.edu/mapserver</font></a><font size=1 face="Arial">"><br>
<<b>Contains</b>><br>
<PropertyName>wkb_Geometry</PropertyName><br>
<gml:Point srsName="urn:ogc:def:crs:EPSG::4326"><br>
<gml:coordinates>0.112034,53.567972</gml:coordinates><br>
</gml:Point><br>
</<b>Contains</b>><br>
</Filter></font>
<br><font size=2 face="Arial">*************************</font>
<br>
<br><font size=2 face="Arial">PostGIS query [Could see in log file]:</font>
<br><font size=2 face="Arial">*************************</font>
<br><font size=1 face="Arial">msPostGISLayerWhichShapes query: select "Attribute1","Attribute2","Attribute3",encode(ST_AsBinary(ST_Force2D("wkb_geometry"),'NDR'),'hex')
as geom from SampleGeoDataTable where </font><font size=1 color=#e01f25 face="Arial"><b><i>wkb_geometry
&& ST_GeomFromText('POLYGON((-0.999462804873474 -1.00102606014116,-0.999462804873474
-1.00102606014116,-0.999462804873474 -1.00102606014116,-0.999462804873474
-1.00102606014116,-0.999462804873474 -1.00102606014116))',find_srid('','SampleGeoDataTable','wkb_geometry'))</i></b></font><font size=1 face="Arial">
and (st_contains(wkb_geometry,ST_GeomFromText('POINT (</font><font size=1 color=#40005f face="Arial"><b><i>7853690.3631838141000000
-5506204.5232773330000000</i></b></font><font size=1 face="Arial">)'))
= TRUE)</font>
<br><font size=2 face="Arial">*************************</font>
<br>
<br><font size=2 face="Arial">Similar WFS query to GeoServer works perfectly.</font>
<br>
<br><font size=2 face="Arial">It would be very helpful if someone can help
me on it. Thanks a lot in advance. </font>
<br>
<br><font size=2 face="Arial">Map File looks like:</font>
<br>
<br><font size=2 face="Arial">**************************************************</font>
<br><font size=1 face="Arial">MAP<br>
NAME "Sample_WMS"<br>
CONFIG "PROJ_LIB" "C:\ms4w\proj\nad"<br>
CONFIG "MS_ERRORFILE" "C:/Data/ms_tmp/ms_error.txt"<br>
CONFIG "CPL_DEBUG" "ON"<br>
CONFIG "PROJ_DEBUG" "ON"<br>
STATUS ON<br>
PROJECTION<br>
"init=epsg:27700"<br>
END <br>
<br>
WEB<br>
IMAGEPATH "C:/Data/ms_tmp/"<br>
IMAGEURL "/ms_tmp/"<br>
METADATA <br>
"wfs_enable_request" "*"<br>
"wfs_title" "My
Global Map WFS Server"<br>
"wfs_srs" "EPSG:4326
EPSG:900913 EPSG:27700"<br>
"wfs_boundingbox" "EPSG:27700
749.099975585938 -90036.5 660460.875 1227306.5" <br>
END<br>
END<br>
<br>
LAYER<br>
NAME "SampleLayer"<br>
STATUS DEFAULT<br>
TYPE POLYGON<br>
PROJECTION<br>
"init=epsg:27700"<br>
END <br>
CONNECTIONTYPE POSTGIS<br>
CONNECTION "host=localhost port=5432 dbname=SampleGeoDataTable
user=postgres password=hahaha"<br>
DATA "wkb_geometry from SampleLayer"<br>
CLASS<br>
STYLE<br>
COLOR 0 100 255<br>
OUTLINECOLOR 0 0 0<br>
END <br>
END<br>
<br>
METADATA <br>
"wfs_enable_request" "*"<br>
"wfs_title" "Sample
WFS"<br>
"wfs_srs" "EPSG:27700
EPSG:4326 EPSG:900913"<br>
"wfs_boundingbox" "EPSG:27700
749.099975585938 -90036.5 660460.875 1227306.5"<br>
"gml_include_items" "all"<br>
END <br>
END <br>
END</font>
<br><font size=2 face="Arial">**************************************************</font>
<br>
<br><font size=2 face="Arial">Regards,<br>
Kajod</font><tt><font size=2>_______________________________________________<br>
mapserver-users mailing list<br>
mapserver-users@lists.osgeo.org<br>
</font></tt><a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users"><tt><font size=2>https://lists.osgeo.org/mailman/listinfo/mapserver-users</font></tt></a>
<br>