[Geoserver-users] geoserver WFS getFeature does not allow both bbox and filtter queries at the same time

Hi,

When running the following:

http://localhost:8080/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=vector%3Agv_collaboration_points%2Cvector%3Agv_collaboration_lines%2Cvector%3Agv_collaboration_polygons%2Cvector%3Apush_pins&MAXFEATURES=20&BBOX=-117.165737%2C32.749554%2C-117.155692%2C32.759598&filter=(%3CFilter%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Egv_layer_lst%3C%2FPropertyName%3E%3CLiteral%3Epolygon1_ngauser%3C%2FLiteral%3E%3C%2FPropertyIsEqualTo%3E%3C%2FFilter%3E)

I get the following response:

filter and bbox both specified but are mutually exclusive

How can I run a geoserver WFS GetFeature against both a bbox and a filter or do I need to embed the bbox within the filter?

Thanks,


John J. Mitchell

They are mutually exclusive, so yes, you have to embed the BBOX filter in
the FILTER.

Best regards,
Bart

Hi,

When running the following:

http://localhost:8080/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=vector%3Agv_collaboration_points%2Cvector%3Agv_collaboration_lines%2Cvector%3Agv_collaboration_polygons%2Cvector%3Apush_pins&MAXFEATURES=20&BBOX=-117.165737%2C32.749554%2C-117.155692%2C32.759598&filter=(<Filter><PropertyIsEqualTo><PropertyName>gv_layer_lst<%2FPropertyName><Literal>polygon1_ngauser<%2FLiteral><%2FPropertyIsEqualTo><%2FFilter>)

I get the following response:

<ServiceExceptionReport version="1.2.0" xsi:schemaLocation="
http://www.opengis.net/ogc
http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd&quot;&gt;
e$B!]e(B
    <ServiceException>

      filter and bbox both specified but are mutually exclusive
</ServiceException>
</ServiceExceptionReport>

How can I run a geoserver WFS GetFeature against both a bbox and a filter
or
do I need to embed the bbox within the filter?

Thanks,

--
John J. Mitchell
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

John Mitchell ha scritto:

Hi,

When running the following:

http://localhost:8080/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=vector%3Agv_collaboration_points%2Cvector%3Agv_collaboration_lines%2Cvector%3Agv_collaboration_polygons%2Cvector%3Apush_pins&MAXFEATURES=20&BBOX=-117.165737%2C32.749554%2C-117.155692%2C32.759598&filter=(%3CFilter%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Egv_layer_lst%3C%2FPropertyName%3E%3CLiteral%3Epolygon1_ng
auser%3C%2FLiteral%3E%3C%2FPropertyIsEqualTo%3E%3C%2FFilter%3E)
<http://localhost:8080/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=vector%3Agv_collaboration_points%2Cvector%3Agv_collaboration_lines%2Cvector%3Agv_collaboration_polygons%2Cvector%3Apush_pins&MAXFEATURES=20&BBOX=-117.165737%2C32.749554%2C-117.155692%2C32.759598&filter=(<Filter><PropertyIsEqualTo><PropertyName>gv_layer_lst<%2FPropertyName><Literal>polygon1_ngauser<%2FLiteral><%2FPropertyIsEqualTo><%2FFilter>)&gt;

I get the following response:

<ServiceExceptionReport version="1.2.0"
xsi:schemaLocation="http://www.opengis.net/ogc
http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd&quot;&gt;

    <ServiceException>

      filter and bbox both specified but are mutually exclusive
</ServiceException>
</ServiceExceptionReport>

How can I run a geoserver WFS GetFeature against both a bbox and a
filter or do I need to embed the bbox within the filter?

You do need to embed. To clarify, this is no GeoServer limitation, it's
part of the OGC specification itself (proably one of the behaviour
stated in the spec docs that the OGC conformance tests are actually
testing too).

Cheers
Andrea

Hi,

Would anyone have an example of integrating bounding box with an attribute query all within the same filter parameter?
Below is a filter just against the attribute but I need to understand how to integrate the below filter with a bounding box filter.

filter = “(gv_layer_lst” +
loadVectorLayerName +
“)”

Thanks,

John

2008/8/26 John Mitchell <mitchelljj98@anonymised.com>

Hi,

When running the following:

http://localhost:8080/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=vector%3Agv_collaboration_points%2Cvector%3Agv_collaboration_lines%2Cvector%3Agv_collaboration_polygons%2Cvector%3Apush_pins&MAXFEATURES=20&BBOX=-117.165737%2C32.749554%2C-117.155692%2C32.759598&filter=(%3CFilter%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Egv_layer_lst%3C%2FPropertyName%3E%3CLiteral%3Epolygon1_ngauser%3C%2FLiteral%3E%3C%2FPropertyIsEqualTo%3E%3C%2FFilter%3E)

I get the following response:

filter and bbox both specified but are mutually exclusive

How can I run a geoserver WFS GetFeature against both a bbox and a filter or do I need to embed the bbox within the filter?

Thanks,


John J. Mitchell


John J. Mitchell

John Mitchell ha scritto:

Hi,

Would anyone have an example of integrating bounding box with an
attribute query all within the same filter parameter?
Below is a filter just against the attribute but I need to understand
how to integrate the below filter with a bounding box filter.

          filter =
"(<Filter><PropertyIsEqualTo><PropertyName>gv_layer_lst</PropertyName><Literal>"
+
                        loadVectorLayerName +
                        "</Literal></PropertyIsEqualTo></Filter>)"

This is a valid POST request with the two filters and-ed. Justtake the
filter part and strip the ogc: prefixes, and you'll be able to use it
as a FILTER=xxx GET parameter:

<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:And>
        <ogc:BBOX>
          <ogc:PropertyName>the_geom</ogc:PropertyName>
          <gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#4326&quot;&gt;
             <gml:coordinates>-75.102613,40.212597
-72.361859,41.512517</gml:coordinates>
          </gml:Box>
        </ogc:BBOX>
        <ogc:PropertyIsEqualTo>
          <ogc:PropertyName>STATE_NAME</ogc:PropertyName>
          <ogc:Literal>New York</ogc:Literal>
         </ogc:PropertyIsEqualTo>
      </ogc:And>
   </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

Hope this helps
Cheers
Andrea