That is not cool;
The method you found, ff.and( filter, filter ) is from the GeoAPI
interface FilterFactory and should not be deprecated. If you are using
the deprecated methods I would be more comfortable if you are consistent
- ie use createLogicalFilter rather than mix and match. The 2.3 branch
has had a lot of trouble with filters, 2.4 will be much better when
justin manages to release it.
If you stop your code in the debugger you should be able to inspect the
resulting filter and ensure it is constructed the way you requested? I
would like to make sure the and method did not screw up.
Only other thing would be confusion about AND vs OR:
AND - will return less features, only the features that meet both cf and
cf1 (although they look the same to me?).
OR - will return more features, the features that meet either cf1 or cf2
Can you confirm that you intended cf1 and cf2 to be the same?
Jody
> This code produces a blank screen, each filter works fine separately:
>
> CompareFilter cf = ff.createCompareFilter(Filter.COMPARE_EQUALS);
> cf.addLeftValue(ff.createAttributeExpression(at.getName()));
> cf.addRightValue(ff.createLiteralExpression(name));
>
> CompareFilter cf1 = ff.createCompareFilter(Filter.COMPARE_EQUALS);
> cf1.addLeftValue(ff.createAttributeExpression(at.getName()));
> cf1.addRightValue(ff.createLiteralExpression(name));
> Filter lf = ff.and(cf, cf1);
> ml.setQuery(new DefaultQuery("",lf)); //ml is mapLayer
>
>
> Note, that I also tried obtaining a LogicalFilter from the
> FilteryFactory createLogicalFilter(..) method and that also
> did not work.
> All these methods seem to be deprecated but the alternatives indicated
> in the javadocs do not exist in the version I am using 2.3.3
>
> Thanx
> gaby
>
>
>
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users