Opened 13 years ago
Last modified 13 years ago
#3955 new defect
WFS GetFeature with BBOX Filter - PropertyName should not be mandatory
Reported by: | adube | Owned by: | mapserverbugs |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | WFS Server | Version: | 6.0 |
Severity: | normal | Keywords: | |
Cc: |
Description
When making WFS GetFeature queries using a BBOX Filter, we currently need to specify a PropertyName or else the query fails and MapServer returns an error mentioning that the filter is not valid.
If we check in the schema definition, the BBOXType PropertyName element has "minOccurs"=0, so it shouldn't be mandatory, see : http://schemas.opengis.net/filter/1.1.0/filter.xsd
Here's a request that currently doesn't work where it should :
<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <wfs:Query typeName="feature:parcel"> <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"> <ogc:BBOX> <gml:Box xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:3785"> <gml:coordinates decimal="." cs="," ts=" "> -8033496.4863128,5677373.0653376 -7988551.5136872,5718801.9346624 </gml:coordinates> </gml:Box> </ogc:BBOX> </ogc:Filter> </wfs:Query> </wfs:GetFeature>
The above outputs :
<?xml version='1.0' encoding="ISO-8859-1" ?> <ServiceExceptionReport version="1.2.0" xmlns="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd"> <ServiceException code="InvalidParameterValue" locator="filter"> msWFSGetFeature(): WFS server error. Invalid or Unsupported FILTER in GetFeature : <Filter ogc="http://www.opengis.net/ogc"> <BBOX> <Box gml="http://www.opengis.net/gml" srsName=& quot;EPSG:3785"> <coordinates decimal="." cs="," ts=" ">-8033496.4863128,5677373.0653376 -7988551.5136872,5718801.9346624</coordinates> </Box> </BBOX> </Filter> </ServiceException> </ServiceExceptionReport>
To make it work properly, we need to specify the PropertyName :
<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <wfs:Query typeName="feature:parcel"> <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"> <ogc:BBOX> <ogc:PropertyName>the_geom</ogc:PropertyName> <gml:Box xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:3785"> <gml:coordinates decimal="." cs="," ts=" "> -8033496.4863128,5677373.0653376 -7988551.5136872,5718801.9346624 </gml:coordinates> </gml:Box> </ogc:BBOX> </ogc:Filter> </wfs:Query> </wfs:GetFeature>
Note:
See TracTickets
for help on using tickets.
adube's request snippet above is WFS 1.0.0, for which the propertyName is mandatory. But the ticket is valid: WFS 1.1.0 does not require a propertyName for the BBOX filter. This ticket is somehow related to http://trac.osgeo.org/openlayers/ticket/3415.