Opened 12 years ago

Last modified 12 years ago

#4190 new defect

getFeature request with custom output format fails on filter encoding

Reported by: mraross Owned by: msogcbugs
Priority: normal Milestone:
Component: WFS Server Version: 6.0
Severity: normal Keywords:
Cc: assefa, aboudreault

Description (last modified by dmorissette)

The following type of filter expressions fail when used with a custom output format called "kayml" defined using a template:

  1. And
  2. Or
  3. IsBetween
  4. IsEqualTo

when &MAXFEATURES is missing or set to a value that is greater than the number of results returned

For details, see attached .zip file

Attachments (2)

ogc_filter_problems.zip (209.1 KB ) - added by mraross 12 years ago.
Failed WFS requests, .map file, .kml template, shapefile
OGC_Filter_Problems_no_ogc_prefix.txt (15.1 KB ) - added by mraross 12 years ago.
getFeature requests with ogc namespace as default namespace in filters

Download all attachments as: .zip

Change History (15)

by mraross, 12 years ago

Attachment: ogc_filter_problems.zip added

Failed WFS requests, .map file, .kml template, shapefile

comment:1 by mraross, 12 years ago

Summary: WFS Filter Encoding Has Problems with Custom Output FormatsgetFeature request for custom output formats has trouble with filter encoding

comment:2 by aboudreault, 12 years ago

Cc: assefa aboudreault added

comment:3 by aboudreault, 12 years ago

mraross, trying to reproduce the issue. Looks like both outputformat (kayml and gml2) need to pass through OGR. So, all request seems to fail... even those using GML that you mentionned to work. Am I missing somethign? Here's the error I got:

msWFSGetFeature(): WFS server error. FLTApplyFilterToLayer() failed
msOGRFileWhichShapes(): OGR error. SetAttributeFilter( (FRAME= 156) ) failed on layer AIRPHOTO_LR_2010.
Type mismatch or improper type of arguments to = operator.

Is your failure message the same than me?

comment:4 by mraross, 12 years ago

Summary: getFeature request for custom output formats has trouble with filter encodinggetFeature request with custom output format fails on filter encoding

Aboudreault, thanks for taking a look at it. I get a valid GML/XML document when I issue the following request:

http://delivery.openmaps.gov.bc.ca/mapserver6/airphoto-viewer?service=WFS&version=1.0.0&request=GetFeature&TypeName=AIRPHOTO_LR_2010&SRS=EPSG:4326&OUTPUTFORMAT=gml2&FILTER=<ogc:Filter xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc"><ogc:And><ogc:PropertyIsEqualTo><ogc:PropertyName>ROLL</ogc:PropertyName><ogc:Literal>15BCC10007</ogc:Literal></ogc:PropertyIsEqualTo><ogc:PropertyIsEqualTo><ogc:PropertyName>FRAME</ogc:PropertyName><ogc:Literal>156</ogc:Literal></ogc:PropertyIsEqualTo></ogc:And></ogc:Filter>

comment:5 by aboudreault, 12 years ago

Using this ticket test case? It looks like I'm missing something , just tested the last request mentionned and still got the same error.

comment:6 by mraross, 12 years ago

Can't explain it but I just verified that the 3 GML cases in ogc_filter_problems.txt return valid GML files in Firefox.

comment:7 by aboudreault, 12 years ago

Ok, and is the error I mentionned is the one you get when trying the kayml outputformat?

comment:8 by mraross, 12 years ago

I get the following error: [Mon Feb 20 11:09:02 2012].496000 getSymbol(): Symbol definition error. Parsing error near (WHERE):(line 1614)

here's the context:

[Mon Feb 20 11:09:02 2012].496000 CGI Request 3 on process 4472 [Mon Feb 20 11:09:02 2012].496000 msConnPoolRequest(AIRPHOTO_LR_2010,2010_photo_centres.shp) -> got 0295D8A8 [Mon Feb 20 11:09:02 2012].496000 msOGRLayerClose(2010_photo_centres.shp). [Mon Feb 20 11:09:02 2012].496000 msOGRFileClose(e:/sw_nt/mapfiles6/sandbox/apps_data/shape/2010_photo_centres.shp,0). [Mon Feb 20 11:09:02 2012].496000 msConnPoolRelease(AIRPHOTO_LR_2010,2010_photo_centres.shp,0295D8A8) [Mon Feb 20 11:09:02 2012].496000 getSymbol(): Symbol definition error. Parsing error near (WHERE):(line 1614) [Mon Feb 20 11:09:02 2012].496000 FLTApplySimpleSQLFilter(): Map file after Filter was applied C:\WINDOWS\4f429a4e_1178_2._filter.map[Mon Feb 20 11:09:02 2012].496000 msConnPoolRequest(AIRPHOTO_LR_2010,2010_photo_centres.shp) -> got 0295D8A8 [Mon Feb 20 11:09:02 2012].590000 mapserv request processing time (msLoadMap not incl.): 0.094s [Mon Feb 20 11:09:02 2012].590000 msFreeMap(): freeing map at 028E2488. [Mon Feb 20 11:09:02 2012].590000 msOGRLayerClose(2010_photo_centres.shp). [Mon Feb 20 11:09:02 2012].590000 msOGRFileClose(e:/sw_nt/mapfiles6/sandbox/apps_data/shape/2010_photo_centres.shp,0). [Mon Feb 20 11:09:02 2012].590000 msConnPoolRelease(AIRPHOTO_LR_2010,2010_photo_centres.shp,0295D8A8) [

by mraross, 12 years ago

getFeature requests with ogc namespace as default namespace in filters

comment:9 by mraross, 12 years ago

In the attached file OGC_Filter_Problems_no_ogc_prefix.txt, I changed the getFeature requests so that the ogc namespace is the default namespace instead of the prefix ogc (e.g., all filter terms no longer require the ogc prefix). Now more things works although there are still serious failures.

comment:10 by chodgson, 12 years ago

Note that this is a duplicate of #4055 which I filed earlier for mraross, however this ticket has much more detailed information.

Also I believe this ticket is related to #2424 and #3739, which sum up as: too many layers of abstraction all "helping" to deal with limiting the number of features and also filtering the resulting features. They also seem to be related to the single-pass query tickets (#3069/#3647) and RFCs (52/65), as that single-pass query needs to include all of the filtering and feature-limiting aspects in it.

I believe what is happening is that some level of the querying is limiting the number of features being fetched BEFORE the the ogc filtering is being applied, which is then causing confusion later as no results end up matching even though some results were expected. The result is that Mapserver doesn't even finish processing the custom output template, producing a broken kml file in this case, as it has no data and no closing document tags.

comment:11 by dmorissette, 12 years ago

Description: modified (diff)

comment:12 by dmorissette, 12 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.