That looks okay to me ... once again step through with the debugger to 
confirm what was created makes sense.
- CQL is easier for this kind of thing
- There is a BETWEEN filter that does exactly this kind of check

Gabriella Turek wrote:
> I want to set up a rule to display data in give interval with a certain
> color:
> I set up the filter as follows:
>
> LogicFilter lf = filterFactory.createLogicFilter(FilterType.LOGIC_AND);
>
> CompareFilter cf =
> filterFactory.createCompareFilter(Filter.COMPARE_GREATER_THAN_EQUAL);
>
> cf.addLeftValue(filterFactory.createAttributeExpression(at.getName()));
> //AttributeType Name
>
> cf.addRightValue(filterFactory.createLiteralExpression(Double.toString(min)));
> // lowerbound
>     lf.addFilter(cf);
>   
AT >= min
>     cf = filterFactory.createCompareFilter(Filter.COMPARE_LESS_THAN);
>     cf.addLeftValue(filterFactory.createAttributeExpression(at.getName()));
>
> cf.addRightValue(filterFactory.createLiteralExpression(Double.toString(max)));
> //upper bound
>
>     lf.addFilter(cf);
>   
AT < max

I seem to recall you are using GeoTools 2.3? Try just using the literal 
double values ... may work out better?

either: cf.addRightValue(filterFactory.createLiteralExpression( max )));

or:

cf.addRightValue(filterFactory.createLiteralExpression( new Double(max) )));

> It does not work. I suspect I am not supposed to use a literal here....
>   
min and max are just values right? nothing dynamic?
> 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

Reply via email to