Mats Norén wrote:
> Hi,
> I'm not sure which list to post this to so I apologize if this should
> have gone to the user-list.
>   
You are into debugging and have narrowed down the problem - good work.  
One of the things you
will find is that there is no active maintainer for the WFS DataStore 
(so we are on our own for
this one).
> I'm having trouble in GeoTools 2.4.1 with my OGC-filter not being sent
> to the WFS Server when using the WFSDataStore.
> The filter is a simple PropertyIsEqualTo. Looking at the code it seems
> that the filter always is pushed on the post-filter stack.
>
> When debugging the actual server capabilities it seems that the server
> does the right thing:
>
> Server Capabilities
> ops = 4128769
> [0] = [EMAIL PROTECTED]"interface org.opengis.filter.PropertyIsNotEqualTo"
> [1] = [EMAIL PROTECTED]"interface
> org.opengis.filter.PropertyIsGreaterThanOrEqualTo"
> [2] = [EMAIL PROTECTED]"interface org.opengis.filter.PropertyIsLessThan"
> [3] = [EMAIL PROTECTED]"interface
> org.opengis.filter.PropertyIsLessThanOrEqualTo"
> [4] = [EMAIL PROTECTED]"interface org.opengis.filter.spatial.BBOX"
> [5] = [EMAIL PROTECTED]"interface org.opengis.filter.PropertyIsGreaterThan"
> [6] = [EMAIL PROTECTED]"interface org.opengis.filter.PropertyIsEqualTo"
>
> Looking at the mask for the servers capabilities it seems like its
> capable of the combined mask:
>
> FilterCapabilities.SIMPLE_COMPARISONS (= 4128768) | SPATIAL_BBOX (=
> 0x01) => ops = 4128769
>
>
> In PostPreProcessFilterSplittingVisitor.java (Line 428) the
> filterCapabilities is compared to the SIMPLE_COMPARISONS_OPENGIS
>
> private void visitBinaryComparisonOperator(BinaryComparisonOperator filter) {
>        if( original==null )
>                  original=filter;
>
>        // supports it as a group -- no need to check the type
>        if (!fcs.supports(FilterCapabilities.SIMPLE_COMPARISONS_OPENGIS) ) {
>              postStack.push(filter);
>              return;
>        }
>          ....
> }     
>
> FilterCapabilities.SIMPLE_COMPARISONS_OPENGIS  has ops=32768    <=
> shouldn't this be == FilterCapabilities.SIMPLE_COMPARISONS = 4128768??
>
> [0] = [EMAIL PROTECTED]"interface org.opengis.filter.PropertyIsNotEqualTo"
> [1] = [EMAIL PROTECTED]"interface
> org.opengis.filter.PropertyIsGreaterThanOrEqualTo"
> [2] = [EMAIL PROTECTED]"interface org.opengis.filter.PropertyIsLessThan"
> [3] = [EMAIL PROTECTED]"interface
> org.opengis.filter.PropertyIsLessThanOrEqualTo"
> [4] = [EMAIL PROTECTED]"interface org.opengis.filter.PropertyIsGreaterThan"
> [5] = [EMAIL PROTECTED]"interface org.opengis.filter.PropertyIsEqualTo"
>
> The actual comparison that fails is:
>
> return (ops & type.ops) == type.ops && functions.containsAll(type.functions);
>
> The second part of the expression correctly returns true
>
>        functions.containsAll(type.functions) => true
>
> however the first part of the expression should be (I guess)
>
> ((FilterCapabilities.SPATIAL_BBOX |
> FilterCapabilities.SIMPLE_COMPARISONS) &
> FilterCapabilities.SIMPLE_COMPARISONS) ==
> FilterCapabilities.SIMPLE_COMPARISONS => true
>
> but looking at the debug values:
>
> ops for the WFS Server = 4128769 and type.ops = 32768
>
> (4128769 & 32768) == 32768 => false
>
> I suspect that the addType(Class type) in FilterCapabilities is the
> culprit but could someone with some more knowledge about the code
> enlighten me to what is going on?
>   
I reviewed this code a month or so ago and it is very confusing; what is 
happening is that it is
building up a list of what filter types are supported by the server. The 
addType( Class ) method
is a short hand for programmers so they can indicate the filter type 
using a Java class: capabilities.addType( BBox.class )

Chances are some of this code needs to notice the GeoAPI interfaces like 
"And" rather than the origional GeoTools
interfaces like "AndFilter".

Cheers,
Jody

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to