[Geoserver-devel] ( GEOS-327 )Filter Encoding - Problems With 'Not'

I tried this on the Geoserver 1.3.0-beta2 version and this query works
fine for me.

You didnt say which version of geoserver you were using - I expect you
were using a 1.2.x version. Why dont you check out the 1.3 version?

dave

<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="states" >
   <Filter>
   <AND>
   <PropertyIsLike wildCard="*" singleChar="#" escapeChar="!">
      <PropertyName>STATE_NAME</PropertyName>
      <Literal>*a*</Literal>
   </PropertyIsLike>
   <PropertyIsLike wildCard="*" singleChar="#" escapeChar="!">
      <PropertyName>STATE_NAME</PropertyName>
      <Literal>*c*</Literal>
   </PropertyIsLike>
</AND>
</Filter>
    </wfs:Query>
</wfs:GetFeature>

----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/

Greetings, David,

Saturday, April 2, 2005, 2:53:32 AM, you wrote:

I tried this on the Geoserver 1.3.0-beta2 version and this query works
fine for me.

You didnt say which version of geoserver you were using - I expect you
were using a 1.2.x version. Why dont you check out the 1.3 version?

Hm, then I've got a question to ask: does GeoServer trunk currently
contain all the code from 1.3beta? I just updated my working copy from
the head (Rev. 3353, I think) and the below WFS request _doesn't_ work
_as_expected_. Following log snippets make it clear that first
argument in AND operations is completely ignored when fetching
features:

88406 [INFO] org.vfny.geoserver.servlets.AbstractService - handling request:
Request: null
output format:GML2
max features:2147483647
version:
queries:
  Query
   feature type: topp:states
   filter: [ STATE_NAME is like *c* ]
   [properties: ALL ]

and shortly thereafter:

88437 [FINE] org.vfny.geoserver.wfs.responses.FeatureResponse - Query is
  Query
   feature type: topp:states
   filter: [ STATE_NAME is like *c* ]
   [properties: ALL ]
To gt2: Query:
   feature type: states
   filter: [ STATE_NAME is like *c* ]
   [properties: ALL ]

As you see, there is no sign of "<Literal>*a*</Literal>" there.
Moreover, similar request to my PostGIS datastore results in following
sql query:

670531 [FINE] org.geotools.data.jdbc.JDBCDataStore - calling sql builder with filter [ str_kod < 500 ]
670531 [FINE] org.geotools.data.jdbc.JDBCDataStore - sql is SELECT "gid", "length", "str_kod", "prz_str",
  "name_str", "pech_str", "sprav_str", AsText(force_2d("the_geom")) FROM "t_streets" WHERE "str_kod" < 500
670531 [FINE] org.geotools.data.jdbc.JDBCDataStore - About to execute query: SELECT "gid", "length",
  "str_kod", "prz_str", "name_str", "pech_str", "sprav_str", AsText(force_2d("the_geom"))
  FROM "t_streets" WHERE "str_kod" < 500

Again, first condition is completely missing. There is no "AND" in
resulting SQL. The same thing with "OR" operation.

I'm not completely sure, but it seems these troubles take their
origin from geotools layer. Unfortunately, I haven't got up-to-date
geotools sources (and haven't even an idea which version of GT is
currently used in Geoserver), so I can't say more on this matter
right now.

<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="states" >
   <Filter>
   <AND>
   <PropertyIsLike wildCard="*" singleChar="#" escapeChar="!">
      <PropertyName>STATE_NAME</PropertyName>
      <Literal>*a*</Literal>
   </PropertyIsLike>
   <PropertyIsLike wildCard="*" singleChar="#" escapeChar="!">
      <PropertyName>STATE_NAME</PropertyName>
      <Literal>*c*</Literal>
   </PropertyIsLike>
</AND>
</Filter>
    </wfs:Query>
</wfs:GetFeature>

--
WBR,
Artie Konin