Hi all,

First time writer/subscriber to the list.

I've been experimenting with POST'd XML WFS requests in GeoServer 2.02
recently and have observed some strange results. Basically, according to my
understanding of the OGC WFS and filter specifications, in a valid WFS
request sent via XML, every XML element is supposed to be properly
namespace-qualified, e.g. something like:

(namespace prefixes/URI's are appropriately defined earlier in the WFS
request)

<ogc:Filter>
   <ogc:PropertyIsBetween>
      <ogc:PropertyName>foo:bar</ogc:PropertyName>
      <ogc:LowerBoundary><ogc:Literal>2</ogc:Literal></ogc:LowerBoundary>
      <ogc:UpperBoundary><ogc:Literal>4</ogc:Literal></ogc:UpperBoundary>
   </ogc:PropertyIsBetween>
</ogc:Filter>

However, when I issue the above request to GeoServer 2.02, it will encounter
a ClassCastException when it tries to perform an unguarded cast from the
"property name" String object to an OpenGIS filter Expression interface
object. If I instead try to replicate the behavior of the PropertyIsBetween
filter by using a PropertyIsLessThan AND'd with a PropertyIsGreaterThan
filter, then I no longer get the exception, but I get 0 features in the
feature collection I get back (and yes, I've confirmed that it should be
getting results back). If I take out either one of the comparisons in the
latter case (i.e. either the PropertyIsLessThan or the
PropertyIsGreaterThan), then I start getting an error message back from the
database because it tries to pass one of the numeric literals as an SQL
string literal in single quotes.


I had come across a similar issue when specifying filters using KVP over
HTTP GET requests before. My fix/workaround/hack/whatever in that case was
that if I removed the namespace qualifiers from all of the filter tags,
things would work just fine. E.g. using something like:

<Filter>
   <PropertyIsBetween>
      <PropertyName>foo:bar</PropertyName>
      <LowerBoundary><Literal>2</Literal></LowerBoundary>
      <UpperBoundary><Literal>4</Literal></UpperBoundary>
   </PropertyIsBetween>
</Filter>

instead would work fine. It appears that this is also the case with XML
requests, as stripping off the namespace qualifiers on the filter
expressions fixes the problem and you get the correct results back
afterward. Is this a known issue, or am I missing something, or am I just
misreading/misinterpreting the OGC standards? Also, is it possible that I
don't have my GeoServer properly configured? Is this a side effect of moving
away from/deprecating the GeoTools filter classes in favor of the OpenGIS
filter interfaces?

(As a slight aside, I have no clue where your guys' implementation classes
for those interfaces are hiding, or whether they're being provided by
another library)

As a final note, I have also tried enabling the "strict CITE compliance"
option on the WFS service and have used the GeoServer-specific "strict=true"
on the client end when submitting my WFS requests, but neither seems to make
any difference over whether the filter expression is accepted with namespace
qualifiers. Any info on this would be greatly appreciated.


Thanks!
Phony
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to