[Geoserver-users] filter request

Hello, all

When i use the geoserver sample data to test a getfeature request. I want to use a filter to get the specified tiger_roads feature, but the response returned all the roards without filtering. I could not find the solution. The request is in the following:
Any comment? thanks a lot!

<wfs:GetFeature service=“WFS” version=“1.0.0”
outputFormat=“GML2”
xmlns:tiger=“http://www.census.gov
xmlns:wfs=“http://www.opengis.net/wfs
xmlns:ogc=“http://www.opengis.net/ogc
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”>


tiger:NAME
Washington Sq W


</wfs:GetFeature>

best regards
fei

When GeoServer makes a WMS request, it can only filter with the bounding box, and scale as specified in the SLD document. This is because of tricky if/else filter clauses in SLD documents that cannot be passed on easily to the datastore. So it requests all of the data (that fits in the bounding box) and then runs the filter on each feature. There is a plan to improve this, don't worry. =)

Brent Owens
(The Open Planning Project)

Fei Wang wrote:

Hello, all
When i use the geoserver sample data to test a getfeature request. I want to use a filter to get the specified tiger_roads feature, but the response returned all the roards without filtering. I could not find the solution. The request is in the following:
Any comment? thanks a lot!
<wfs:GetFeature service="WFS" version="1.0.0"
  outputFormat="GML2"
  xmlns:tiger="http://www.census.gov"
  xmlns:wfs="http://www.opengis.net/wfs&quot;
  xmlns:ogc="http://www.opengis.net/ogc&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;
  <Query typeName="tiger:tiger_roads">
          <PropertyIsEqualTo>
                <PropertyName>tiger:NAME</PropertyName>
                <Literal>Washington Sq W</Literal>
          </PropertyIsEqualTo>
    </Query>
</wfs:GetFeature>

best regards
fei

You need a 'Filter' in your query, around the PropertyIsEqualTo. See the example requests in the demo section of GeoServer. And check the Filter specification. Your request must follow the rules of the XML for Filters.

   <Query typeName="tiger:tiger_roads">
       <Filter>
            <PropertyIsEqualTo>
                  <PropertyName>tiger:NAME</PropertyName>
                  <Literal>Washington Sq W</Literal>
            </PropertyIsEqualTo>
       </Filter>
   </Query>

I think is what you need.

Chris

Fei Wang wrote:

Hello, all

When i use the geoserver sample data to test a getfeature request. I want to use a filter to get the specified tiger_roads feature, but the response returned all the roards without filtering. I could not find the solution. The request is in the following:
Any comment? thanks a lot!

<wfs:GetFeature service="WFS" version="1.0.0"
  outputFormat="GML2"
  xmlns:tiger="http://www.census.gov"
  xmlns:wfs="http://www.opengis.net/wfs&quot;
  xmlns:ogc="http://www.opengis.net/ogc&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;
  <Query typeName="tiger:tiger_roads">
          <PropertyIsEqualTo>
                <PropertyName>tiger:NAME</PropertyName>
                <Literal>Washington Sq W</Literal>
          </PropertyIsEqualTo>
    </Query>
</wfs:GetFeature>

best regards
fei

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

hi, Chris

Thank you for that! That is the way it should be. It works now.

regards
fei
----- Original Message ----- From: "Chris Holmes" <cholmes@anonymised.com>
To: "Fei Wang" <fei.wang@anonymised.com>
Cc: <geoserver-users@lists.sourceforge.net>
Sent: Tuesday, May 30, 2006 8:15 PM
Subject: Re: [Geoserver-users] filter request

You need a 'Filter' in your query, around the PropertyIsEqualTo. See
the example requests in the demo section of GeoServer. And check the
Filter specification. Your request must follow the rules of the XML for
Filters.

  <Query typeName="tiger:tiger_roads">
      <Filter>
           <PropertyIsEqualTo>
                 <PropertyName>tiger:NAME</PropertyName>
                 <Literal>Washington Sq W</Literal>
           </PropertyIsEqualTo>
      </Filter>
  </Query>

I think is what you need.

Chris

Fei Wang wrote:

Hello, all

When i use the geoserver sample data to test a getfeature request. I want to use a filter to get the specified tiger_roads feature, but the response returned all the roards without filtering. I could not find the solution. The request is in the following:
Any comment? thanks a lot!

<wfs:GetFeature service="WFS" version="1.0.0"
  outputFormat="GML2"
  xmlns:tiger="http://www.census.gov"
  xmlns:wfs="http://www.opengis.net/wfs&quot;
  xmlns:ogc="http://www.opengis.net/ogc&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;
  <Query typeName="tiger:tiger_roads">
          <PropertyIsEqualTo>
                <PropertyName>tiger:NAME</PropertyName>
                <Literal>Washington Sq W</Literal>
          </PropertyIsEqualTo>
    </Query>
</wfs:GetFeature>

best regards
fei

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org