Opened 12 years ago

Last modified 12 years ago

#4073 new defect

WFS GetFeature with spatial filter returns inconsistent result

Reported by: elzouavo Owned by: mapserverbugs
Priority: normal Milestone: 5.6.7 release
Component: WFS Server Version: 5.6
Severity: normal Keywords:
Cc:

Description

Hie,

I have a mapfile that exposes a mapinfo file in WMS and WFS. I do WFS requests with spatial filter encoding. The result was good with MapServer 5.6.2. Since 5.6.5 I have inconsistent results. There are no objects returned or wrong ones. The filter Intersects worked fine but now it is no longer usable.

Example :

http://localhost/mapserv?map=/home/toto/pb_wfs.map
&SERVICE=WFS
&VERSION=1.0.0
&REQUEST=GetFeature
&TYPENAME=c_DEPARTEMENT_L93_cartelie
&FILTER=
(<Filter>
  <Intersects>
    <PropertyName>msGeometry</PropertyName>
    <gml:Polygon>
      <gml:outerBoundaryIs>
        <gml:LinearRing>
          <gml:coordinates+cs=","+decimal="."+ts="+">1029809.6969999999,6864818.84 1029809.6969999999,6837612.648+1065387.025,6829241.512 1073758.1609999998,6852262.136+1052830.321,6875282.76 1029809.6969999999,6864818.84</gml:coordinates>
        </gml:LinearRing>
      </gml:outerBoundaryIs>
    </gml:Polygon>
  </Intersects>
</Filter>)

Normally this request should return an object representing the Bas-Rhin departement (France). With MapServer 5.6.5 and 5.6.7 it returns the Ain Departement.

Is there a solution for this issue ?

Thanks

Attachments (1)

pb_wfs.zip (12.5 KB ) - added by elzouavo 12 years ago.
Mapfile and MapInfo file

Download all attachments as: .zip

Change History (8)

by elzouavo, 12 years ago

Attachment: pb_wfs.zip added

Mapfile and MapInfo file

comment:1 by dmorissette, 12 years ago

Are both installations of MapServer running the same version of the GDAL/OGR library? If not then what are the versions?

Also, since 5.6.x is no longer supported, did you have a chance to test this with 6.0.x or the current dev version in trunk?

comment:2 by elzouavo, 12 years ago

Thanks for your answer. With MapServer 5.6.2 we used gdal 1.6.2. With MapServer 5.6.5 we 've tested gdal 1.8.0. We have had some issues with gdal 1.8.0 and we had to recompile with gdal 1.7.2. So, with MapServer 5.6.7 we have gdal 1.7.2. We have several applications that use MapServer. Mapserver 6.0 brings many changes in the mapfiles, especially for the OGC Web Services. So we can't quickly bring all of these applications in version 6.0. Thanks a lot

comment:3 by elzouavo, 12 years ago

I compiled MapServer 5.6.7 with gdal 1.6.2 and the issue persists. I'm not sure that MapServer 6 has a correct behavior with WFS requests using spatial filter. I'm a little disappointed. We'll have to ask all of our project owners to bring their applications in MapServer 6.0. We will test this version to see if the WMS and WFS requests with FE including spatial filters. However, a big thanks for all your work.

comment:4 by dmorissette, 12 years ago

Thanks for this test. It confirms at least that the issue is not directly related to the GDAL version and is very likely something that was introduced between MS 5.6.2 and 5.6.7.

Before you consider migrating all your users to 6.0 (since we don't know if the issue is present there or not), are you able to make a quick test to tell us if you find the same issue in 6.0.x as well?

comment:5 by elzouavo, 12 years ago

I've tested on MapServer 6.0 (with GDAL 1.8.0) and the mentioned test WFS works now correctly. Our applications can not migrate quickly to MapServer 6.0. We need to realise more tests to be sure that it's worth to investigate in that way. I am anyway lessee of a solution in 5.6.7...

comment:6 by elzouavo, 12 years ago

I made a mistake. This only works with version 5.6.0 and not with version 5.6.2.

comment:7 by elzouavo, 12 years ago

In fact there are still problems with version 5.6.0. GET requests work correctly but not those in POST. For everything to work properly about GET and POST, you must use the version 5.6.0 beta 3. However, there are different behaviors between the same request in POST and in GET. For example :

  • WFS request with filter PropertyIsEqualTo and matchCase="false" doesn't work and retuns an error in GET but works correctly in POST.

GET Request : http://mapserver-i2.cete-mediterranee.i2/maps/mapserv?map=%2Fopt%2Fdatas%2Fcartelie%2Fcartes%2FCETE_Mediterr%2Fdeal_971.i2.map&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=c_L_PARCELLES_PCI_971_2006&FILTER=%28%3CFilter%3E%3CAnd%3E%3CPropertyIsEqualTo%20matchCase%3D%22false%22%3E%3CPropertyName%3EIDENT%3C/PropertyName%3E%3CLiteral%3E97101CZ280%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3CBBOX%3E%3CPropertyName%3EmsGeometry%3C/PropertyName%3E%3CBox%20srsName%3D%22EPSG%3A32620%22%3E%3Ccoordinates%3E460195.08300000004%2C1726456.19%20736410.447%2C2029440.71%3C/coordinates%3E%3C/Box%3E%3C/BBOX%3E%3C/And%3E%3C/Filter%3E%29 Return : msWFSGetFeature(): WFS server error. FLTApplyFilterToLayer() failed msOGRFileWhichShapes(): OGR error. SetAttributeFilter( (lower(IDENT) = lower('97101CZ280') ) ) failed on layer c_L_PARCELLES_PCI_971_2006. Failed to identify field:lower

POST request : URL : http://mapserver-i2.cete-mediterranee.i2/maps/mapserv?map=/opt/datas/cartelie/cartes/CETE_Mediterr/deal_971.i2.map& POST : <?xml version="1.0" encoding="utf-8"?> <GetFeature version="1.0.0" service="WFS" outputFormat="GML2" xmlns:ms="http://mapserver.gis.umn.edu/mapserver" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns="http://www.opengis.net/wfs" xsi:schemaLocation="http://www.opengis.net/wfs ../wfs/1.0.0/WFS-basic.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<Query typeName="c_L_PARCELLES_PCI_971_2006">

<ogc:Filter>

<ogc:And>

<ogc:BBOX>

<ogc:PropertyName>msGeometry</ogc:PropertyName> <gml:Box xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:32620">

<gml:coordinates>655896.39402696735,1797133.5686750126 656738.08858347882,1797605.0427078409</gml:coordinates>

</gml:Box>

</ogc:BBOX> <ogc:PropertyIsEqualTo>

<ogc:PropertyName>IDENT</ogc:PropertyName> <ogc:Literal>97101CZ280</ogc:Literal>

</ogc:PropertyIsEqualTo>

</ogc:And>

</ogc:Filter>

</Query>

</GetFeature>

NB: I'm not sure of the validity of my WMS GetMap request in POST, but I think MapServer 5.6.0 beta 3 does not work either for these queries.

Note: See TracTickets for help on using tickets.