I'm trying to get a feature/features from a small area using the BBOX (or INTERSECTS) filter in my WFS query. I should be expecting only a small set of features or a single feature and yet the query returns quite a handsome bunch of them.
I have GeoServer version 2.2.2 with an Oracle data store. I have disabled the 'loose bbox' selection so that shouldn't be the cause of the problem.
Here's the query with a BBOX filter:
<wfs:GetFeature
xmlns:wfs="http://www.opengis.net/wfs"
service="WFS"
version="1.1.0"
outputFormat="json"
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<wfs:Query typeName="LiVi:LIIKENNE_ELEMENTTI" srsName="EPSG:3067" xmlns:LiVi="http://172.17.14.211:8080/LiVi">
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:BBOX>
<ogc:PropertyName>GEOMETRY</ogc:PropertyName>
<gml:Envelope xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:3067">
<gml:lowerCorner>316600 6838986</gml:lowerCorner>
<gml:upperCorner>327696 6844298</gml:upperCorner>
</gml:Envelope>
</ogc:BBOX>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>
The problem persists with the INTERSECTS filter. The size of the polygon is about 10 x 10 meters.
<wfs:GetFeature
xmlns:wfs="http://www.opengis.net/wfs"
service="WFS"
version="1.1.0"
outputFormat="json"
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<wfs:Query typeName="LiVi:LIIKENNE_ELEMENTTI" srsName="EPSG:3067" xmlns:LiVi="http://172.17.14.211:8080/LiVi">
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:Intersects>
<ogc:PropertyName>GEOMETRY</ogc:PropertyName>
<gml:Polygon xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:3067">
<gml:exterior>
<gml:LinearRing>
<gml:posList>308082.07106781186 6833724.928932188 308082.07106781186 6833739.071067812 308067.92893218814 6833739.071067812 308067.92893218814 6833724.928932188 308082.07106781186 6833724.928932188</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</ogc:Intersects>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>
Edit:
Here's another request (this time a GET request):
Even though the BBOX area is quite small, I get 1263 features back, most of which don't even fall inside the bounds specified in the request. For instance, from one of the features in the response:
<gml:boundedBy>
<gml:Envelope srsDimension="2" srsName="http://www.opengis.net/gml/srs/epsg.xml#3067">
<gml:lowerCorner>317629.69841038 6841957.478078741</gml:lowerCorner>
<gml:upperCorner>317902.64972173725 6841987.000123474</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>