[Geoserver-users] A serious problem with wfs bbox

Hi,

I meet a problem with geoserver’s wfs.

The problem is:

I send a BBOX to query layer A,if the layer A 's geometry is “point”,there is no problem,if the layer A 's geometry is “linestring” or “polygon”,at most time,the response is wrong.

For example,in the BBOX,there is nothing,but the response I queryed using the BBOX is not nothing.Then I run the Demos of geoserver,I also have found the same problem.

My geoserver is 2.0.2.Tomcat is 6.0.29.When I run the Demos in geoserver “WFS_getFeatureBBOX-1.0.xml”,I am very confused.

I only update the demo’s coordinates .the demo I updated is:

<wfs:GetFeature service=“WFS” version=“1.0.0”
outputFormat=“GML2”
xmlns:topp=“http://www.openplans.org/topp
xmlns:wfs=“http://www.opengis.net/wfs
xmlns:ogc=“http://www.opengis.net/ogc
xmlns:gml=“http://www.opengis.net/gml
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation=“http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd”>
<wfs:Query typeName=“topp:states”>
ogc:PropertyNametopp:STATE_NAME</ogc:PropertyName>
ogc:PropertyNametopp:PERSONS</ogc:PropertyName>
ogc:Filter
ogc:BBOX
ogc:PropertyNamethe_geom</ogc:PropertyName>
<gml:Box srsName=“http://www.opengis.net/gml/srs/epsg.xml#4326”>
gml:coordinates-96.59055589968114,26.815362466713715 -95.29462605408101,27.807862077780122</gml:coordinates>
</gml:Box>
</ogc:BBOX>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

I have only changed “gml:coordinates”, in “”'s BBOX there should be nothing on the layer “topp:states”,but when

I click the button “submit”,I can get the result:

<wfs:FeatureCollection xsi:schemaLocation=“http://www.openplans.org/topp http://localhost:8080/geoserver/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=topp%3Astates http://www.opengis.net/wfs http://localhost:8080/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd”>

gml:boundedBy
gml:nullunknown</gml:null>
</gml:boundedBy>

gml:featureMember

<topp:states fid=“states.15”>
topp:STATE_NAMETexas</topp:STATE_NAME>
topp:PERSONS1.712202E7</topp:PERSONS>
</topp:states>
</gml:featureMember>
</wfs:FeatureCollection>

In the BBOX,there should be nothing,but why not null the response is?

Please advise.

Zhao

On Tue, Oct 26, 2010 at 9:08 AM, chen zhao <dreamthinkinger@anonymised.com> wrote:

Hi,

I meet a problem with geoserver's wfs.

The problem is:

I send a BBOX to query layer A,if the layer A 's geometry is "point",there
is no problem,if the layer A 's geometry is "linestring" or "polygon",at
most time,the response is wrong.

For example,in the BBOX,there is nothing,but the response I queryed using
the BBOX is not nothing.Then I run the Demos of geoserver,I also have found
the same problem.

My geoserver is 2.0.2.Tomcat is 6.0.29.When I run the Demos in geoserver
"WFS_getFeatureBBOX-1.0.xml",I am very confused.

I only update the demo's coordinates .the demo I updated is:

<!-- Performs a get feature with a bounding box filter. -->
<!-- The BBOX filter is a convenience for a <Not><Disjoint>, -->
<!-- it fetches all features that spatially interact with the given box. -->
<!-- This example also shows how to request specific properties, in this -->
<!-- case we just get the STATE_NAME and PERSONS -->

<wfs:GetFeature service="WFS" version="1.0.0"
  outputFormat="GML2"
  xmlns:topp="http://www.openplans.org/topp&quot;
  xmlns:wfs="http://www.opengis.net/wfs&quot;
  xmlns:ogc="http://www.opengis.net/ogc&quot;
  xmlns:gml="http://www.opengis.net/gml&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation="http://www.opengis.net/wfs
                      http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd&quot;&gt;
  <wfs:Query typeName="topp:states">
    <ogc:PropertyName>topp:STATE_NAME</ogc:PropertyName>
    <ogc:PropertyName>topp:PERSONS</ogc:PropertyName>
    <ogc:Filter>
      <ogc:BBOX>
        <ogc:PropertyName>the_geom</ogc:PropertyName>
        <gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#4326&quot;&gt;
           <gml:coordinates>-96.59055589968114,26.815362466713715
-95.29462605408101,27.807862077780122</gml:coordinates>
        </gml:Box>
      </ogc:BBOX>
   </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

I have only changed "<gml:coordinates>", in "<gml :coordinates>"'s BBOX
there should be nothing on the layer "topp:states",but when

I click the button "submit",I can get the result:

<wfs:FeatureCollection xsi:schemaLocation="http://www.openplans.org/topp
http://localhost:8080/geoserver/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=topp%3Astates
http://www.opengis.net/wfs
http://localhost:8080/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd&quot;&gt;
-
<gml:boundedBy>
<gml:null>unknown</gml:null>
</gml:boundedBy>
-
<gml:featureMember>
-
<topp:states fid="states.15">
<topp:STATE_NAME>Texas</topp:STATE_NAME>
<topp:PERSONS>1.712202E7</topp:PERSONS>
</topp:states>
</gml:featureMember>
</wfs:FeatureCollection>

In the BBOX,there should be nothing,but why not null the response is?

Because GeoServer uses by default a bbox vs bbox intersection type for
the bbox operator.
You have two options:
- disable "loose bbox" in your datastore configuration (available only
for databases).
  This will however have the side effect of making the WMS significantly slower
- use the intersection filter instead of the bbox one

Cheers
Andrea

-----------------------------------------------------
Ing. Andrea Aime
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-----------------------------------------------------