<html><head></head><body><div style="color:#000; background-color:#fff; font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px"><div id="yui_3_16_0_ym19_1_1493216863251_3407">Hi Steve,</div><div id="yui_3_16_0_ym19_1_1493216863251_3409"><br></div><div id="yui_3_16_0_ym19_1_1493216863251_3406">Thanks for your response.<br></div><div id="yui_3_16_0_ym19_1_1493216863251_3388"><span><br></span></div><div id="yui_3_16_0_ym19_1_1493216863251_3387"><span id="yui_3_16_0_ym19_1_1493216863251_3386">I have already tried with supplying SRS name in query. Now tried again, but results are still same.</span></div><div id="yui_3_16_0_ym19_1_1493216863251_3424"><span id="yui_3_16_0_ym19_1_1493216863251_3386"><br></span></div><div id="yui_3_16_0_ym19_1_1493216863251_3426"><span id="yui_3_16_0_ym19_1_1493216863251_3386">Do you/someone know if I can somehow remove default spatial filter applied while MapServer makes a call to PostGIS?<br></span></div><div id="yui_3_16_0_ym19_1_1493216863251_3425"><span id="yui_3_16_0_ym19_1_1493216863251_3386"><br></span></div><div id="yui_3_16_0_ym19_1_1493216863251_3515"><span id="yui_3_16_0_ym19_1_1493216863251_3386">Thanks.</span></div><div id="yui_3_16_0_ym19_1_1493216863251_3385"> </div><div class="signature" id="yui_3_16_0_ym19_1_1493216863251_3370"><font size="2">Regards,<br>Kajod<br></font></div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1493216863251_3337"><br><br></div><div class="yahoo_quoted" id="yui_3_16_0_ym19_1_1493216863251_3341" style="display: block;">  <div style="font-family: Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 13px;" id="yui_3_16_0_ym19_1_1493216863251_3340"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1493216863251_3339"> <div dir="ltr" id="yui_3_16_0_ym19_1_1493216863251_3338"> <font id="yui_3_16_0_ym19_1_1493216863251_3346" face="Arial" size="2"> <hr id="yui_3_16_0_ym19_1_1493216863251_3527" size="1"> <b><span style="font-weight:bold;">From:</span></b> Steve Toutant <Steve.Toutant@inspq.qc.ca><br> <b><span style="font-weight: bold;">To:</span></b> Kajod Sharma <kajod4u@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> "mapserver-users@lists.osgeo.org" <mapserver-users@lists.osgeo.org><br> <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, 26 April 2017 3:05 PM<br> <b id="yui_3_16_0_ym19_1_1493216863251_3541"><span style="font-weight: bold;" id="yui_3_16_0_ym19_1_1493216863251_3540">Subject:</span></b> RE: [mapserver-users] Issue in using MapServer WFS Filter<br> </font> </div> <div class="y_msg_container" id="yui_3_16_0_ym19_1_1493216863251_3347"><br><div id="yiv5793431419"><div id="yui_3_16_0_ym19_1_1493216863251_3348"><font id="yui_3_16_0_ym19_1_1493216863251_3542" face="sans-serif" size="2">Try adding </font><font id="yui_3_16_0_ym19_1_1493216863251_3533" face="Liberation Mono" size="3" color="#2f2f2f">&srsName="EPSG:4326"
as a parameter</font>
<br clear="none"><font id="yui_3_16_0_ym19_1_1493216863251_3534" face="Arial" size="1">typeName=SampleLayer</font><font face="Liberation Mono" size="3" color="#2f2f2f">&srsName=EPSG:4326</font>
<br clear="none">
<br clear="none">
<br clear="none">
<br clear="none"><font face="sans-serif" size="1" color="#5f5f5f">De :      
 </font><font id="yui_3_16_0_ym19_1_1493216863251_3535" face="sans-serif" size="1">Kajod Sharma <kajod4u@yahoo.com></font>
<br clear="none"><font face="sans-serif" size="1" color="#5f5f5f">A :      
 </font><font id="yui_3_16_0_ym19_1_1493216863251_3536" face="sans-serif" size="1">"mapserver-users@lists.osgeo.org"
<mapserver-users@lists.osgeo.org></font>
<br clear="none"><font id="yui_3_16_0_ym19_1_1493216863251_3537" face="sans-serif" size="1" color="#5f5f5f">Date :      
 </font><font id="yui_3_16_0_ym19_1_1493216863251_3543" face="sans-serif" size="1">2017-04-26 09:43</font>
<br clear="none"><font face="sans-serif" size="1" color="#5f5f5f">Objet :    
   </font><font face="sans-serif" size="1">[mapserver-users]
Issue in using MapServer WFS Filter</font>
<br clear="none"><font face="sans-serif" size="1" color="#5f5f5f">Envoyé par :    
   </font><font face="sans-serif" size="1">"mapserver-users"
<mapserver-users-bounces@lists.osgeo.org></font>
<div class="yiv5793431419yqt6535659515" id="yiv5793431419yqtfd34578"><br clear="none">
<hr noshade="">
<br clear="none">
<br clear="none">
<br clear="none"><font face="Arial" size="2">Hi,</font>
<br clear="none">
<br clear="none"><font face="Arial" size="2">Greetings!</font>
<br clear="none">
<br clear="none"><font face="Arial" size="2">I hope this is a right platform to discuss
my query regarding FILTER applied on MapServer WFS.</font>
<br clear="none">
<br clear="none"><font face="Arial" size="2">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 clear="none">
<br clear="none"><font face="Arial" size="2">I can see two problems when it applies Filter
query on PostGIS:</font>
<br clear="none">
<br clear="none"><font face="Arial" size="2" color="#e01f25">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 clear="none"><font face="Arial" size="2" color="#40005f">2. It seems Contains coordinates
are not transformed properly according to SRS of data in PostGIS.</font>
<br clear="none">
<br clear="none"><font face="Arial" size="2">I've tries with different projection in map
file and request message with no success.</font>
<br clear="none">
<br clear="none"><font face="Arial" size="2">Supporting data to give your input on my
queries:</font>
<br clear="none">
<br clear="none"><font face="Arial" size="2">WFS request</font>
<br clear="none"><font face="Arial" size="2">*************************</font>
<br clear="none"><font face="Arial" size="2">Formatted Version:</font>
<br clear="none">
<br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://localhost/cgi-bin/mapserv.exe?"><font face="Arial" size="1">http://localhost/cgi-bin/mapserv.exe?</font></a><font face="Arial" size="1"><br clear="none">
service=WFS&<br clear="none">
map=C:/Data/MapServerWFSSample.map&<br clear="none">
request=GetFeature&<br clear="none">
version=2.0.0&<br clear="none">
typeName=SampleLayer&<br clear="none">
FILTER=<Filter xmlns="</font><a rel="nofollow" shape="rect" target="_blank" href="http://www.opengis.net/ogc"><font face="Arial" size="1">http://www.opengis.net/ogc</font></a><font face="Arial" size="1">"
xmlns:gml="</font><a rel="nofollow" shape="rect" target="_blank" href="http://www.opengis.net/gml"><font face="Arial" size="1">http://www.opengis.net/gml</font></a><font face="Arial" size="1">"
xmlns:ms="</font><a rel="nofollow" shape="rect" target="_blank" href="http://mapserver.gis.umn.edu/mapserver"><font face="Arial" size="1">http://mapserver.gis.umn.edu/mapserver</font></a><font face="Arial" size="1">"><br clear="none">
  <<b>Contains</b>><br clear="none">
    <PropertyName>wkb_Geometry</PropertyName><br clear="none">
    <gml:Point srsName="urn:ogc:def:crs:EPSG::4326"><br clear="none">
      <gml:coordinates>0.112034,53.567972</gml:coordinates><br clear="none">
    </gml:Point><br clear="none">
  </<b>Contains</b>><br clear="none">
</Filter></font>
<br clear="none"><font face="Arial" size="2">*************************</font>
<br clear="none">
<br clear="none"><font face="Arial" size="2">PostGIS query [Could see in log file]:</font>
<br clear="none"><font face="Arial" size="2">*************************</font>
<br clear="none"><font face="Arial" size="1">msPostGISLayerWhichShapes query: select "Attribute1","Attribute2","Attribute3",encode(ST_AsBinary(ST_Force2D("wkb_geometry"),'NDR'),'hex')
as geom from SampleGeoDataTable where </font><font face="Arial" size="1" color="#e01f25"><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 face="Arial" size="1">
and (st_contains(wkb_geometry,ST_GeomFromText('POINT (</font><font face="Arial" size="1" color="#40005f"><b><i>7853690.3631838141000000
-5506204.5232773330000000</i></b></font><font face="Arial" size="1">)'))
= TRUE)</font>
<br clear="none"><font face="Arial" size="2">*************************</font>
<br clear="none">
<br clear="none"><font face="Arial" size="2">Similar WFS query to GeoServer works perfectly.</font>
<br clear="none">
<br clear="none"><font face="Arial" size="2">It would be very helpful if someone can help
me on it. Thanks a lot in advance. </font>
<br clear="none">
<br clear="none"><font face="Arial" size="2">Map File looks like:</font>
<br clear="none">
<br clear="none"><font face="Arial" size="2">**************************************************</font>
<br clear="none"><font face="Arial" size="1">MAP<br clear="none">
  NAME "Sample_WMS"<br clear="none">
  CONFIG "PROJ_LIB" "C:\ms4w\proj\nad"<br clear="none">
  CONFIG "MS_ERRORFILE" "C:/Data/ms_tmp/ms_error.txt"<br clear="none">
  CONFIG "CPL_DEBUG" "ON"<br clear="none">
  CONFIG "PROJ_DEBUG" "ON"<br clear="none">
  STATUS ON<br clear="none">
  PROJECTION<br clear="none">
    "init=epsg:27700"<br clear="none">
  END  <br clear="none">
  <br clear="none">
  WEB<br clear="none">
   IMAGEPATH "C:/Data/ms_tmp/"<br clear="none">
   IMAGEURL "/ms_tmp/"<br clear="none">
   METADATA  <br clear="none">
    "wfs_enable_request" "*"<br clear="none">
    "wfs_title"         "My
Global Map WFS Server"<br clear="none">
    "wfs_srs"           "EPSG:4326
EPSG:900913 EPSG:27700"<br clear="none">
    "wfs_boundingbox"    "EPSG:27700
749.099975585938 -90036.5 660460.875 1227306.5"     <br clear="none">
   END<br clear="none">
  END<br clear="none">
  <br clear="none">
  LAYER<br clear="none">
   NAME "SampleLayer"<br clear="none">
   STATUS DEFAULT<br clear="none">
   TYPE POLYGON<br clear="none">
   PROJECTION<br clear="none">
    "init=epsg:27700"<br clear="none">
   END   <br clear="none">
   CONNECTIONTYPE POSTGIS<br clear="none">
   CONNECTION "host=localhost port=5432 dbname=SampleGeoDataTable
user=postgres password=hahaha"<br clear="none">
   DATA "wkb_geometry from SampleLayer"<br clear="none">
   CLASS<br clear="none">
     STYLE<br clear="none">
      COLOR      0 100 255<br clear="none">
      OUTLINECOLOR 0 0 0<br clear="none">
     END <br clear="none">
   END<br clear="none">
  <br clear="none">
   METADATA      <br clear="none">
    "wfs_enable_request" "*"<br clear="none">
    "wfs_title"         "Sample
WFS"<br clear="none">
    "wfs_srs"           "EPSG:27700
EPSG:4326 EPSG:900913"<br clear="none">
    "wfs_boundingbox"    "EPSG:27700
749.099975585938 -90036.5 660460.875 1227306.5"<br clear="none">
    "gml_include_items" "all"<br clear="none">
   END  <br clear="none">
  END    <br clear="none">
END</font>
<br clear="none"><font face="Arial" size="2">**************************************************</font>
<br clear="none">
<br clear="none"><font face="Arial" size="2">Regards,<br clear="none">
Kajod</font></div><tt><font size="2">_______________________________________________<br clear="none">
mapserver-users mailing list<br clear="none">
mapserver-users@lists.osgeo.org<br clear="none">
</font></tt><a rel="nofollow" shape="rect" target="_blank" href="https://lists.osgeo.org/mailman/listinfo/mapserver-users"><tt><font size="2">https://lists.osgeo.org/mailman/listinfo/mapserver-users</font></tt></a><div class="yiv5793431419yqt6535659515" id="yiv5793431419yqtfd04213">
<br clear="none"></div></div></div><br><br></div> </div> </div>  </div></div></body></html>