Opened 14 years ago

Last modified 14 years ago

#3584 new enhancement

WFS GetFeature with one BBOX Filter and two layers does not work.

Reported by: warmerdam Owned by: mapserverbugs
Priority: normal Milestone: 6.0 release
Component: WFS Server Version: unspecified
Severity: normal Keywords:
Cc: rouault

Description

Issuing the request:

mapserv QUERY_STRING="map=wfs_ogr.map&SERVICE=WFS&VERSION=1.0.0
&REQUEST=GetFeature&TYPENAME=road,popplace&OUTPUTFORMAT=GML2
&FILTER=<Filter><BBOX><PropertyName>POINT</PropertyName><Box+srsName=%22EPSG:4326%22>
<coordinates>-64,44+-63,45</coordinates></Box></BBOX></Filter>"

In the msautotest/wxs directory results in a GML result with only roads, and no popplace entries. Reversing TYPENAME to be TYPENAME=popplace,road results in output with popplaces but no roads. With no FILTER features from both layers are returned.

MapServer's WFS GetFeature implementation of FILTER seems to expect there to be multiple filters if there are multiple layers listed in TYPENAME but I do not see any implication in the WFS spec that this is required. In particular, Even notes that page 42 of the WFS 1.1 spec has an example with a single spatial filter and multiple typenames. He has also confirmed that this approach works with an Ionic server.

I will note that listing the bbox filter twice does work with MapServer (each enclosed in brackets). But I am dubious that the specification requires this.

Change History (7)

comment:1 by assefa, 14 years ago

From what I understand the specs specify that each typename should have a filter. Here is what is defined on page 100 of the wfs 1.1. 0 spec (OGC 04-094)

"A filter specification describes a set of features to operate upon. The filter is defined as specified in the Filter Encoding Specification [3]. If the FILTER parameter is used, one filter must be specified for each feature type listed in the TYPENAME parameter. Individual filters encoded in the FILTER parameter are enclosed in parentheses “(“ and “)”."

I checked p42, but could not see the example you refer. Are you referring to the same OGC document 04-094

comment:3 by assefa, 14 years ago

Milestone: 6.0 release
Type: defectenhancement

I do not really have a strong opinion one way or the other. If It is really more practical, we can also support it in MapSever. In case of only one filter, we could apply it to all layers else we should have one filter per typename.

comment:4 by warmerdam, 14 years ago

I don't feel strongly about whether we should support an extension to apply single filters over multiple types, but I do think the current behavior, which is to silently ignore layers requested that lack a corresponding filter is not great. If we strictly want a filter per layer then we should error out if the counts don't match.

comment:5 by assefa, 14 years ago

Agreed. I thought an exception was returned but the test was incomplete. I looked for the test in wxs that uses 2 typenames TYPENAME=road,popplace before committing but could not locate it, is there one or was this just local test?

comment:6 by warmerdam, 14 years ago

Assefa,

There is a "wfsogr10_twolayer.xml" test in msautotest/wxs/wfs_ogr.map but the typenames are reversed in the final test and I doubled up the filter.

comment:7 by assefa, 14 years ago

added in r10650 to return an exception if there is a mismatch between filter and typname. It is now at least consistent with the spec.

Note: See TracTickets for help on using tickets.