Yeah, the filter interfaces are now based on geoapi (. The following is 
the equivalent:

import org.opengis.filter.FilterFactory;
import org.opengis.filter.PropertyIsEqualTo;
...

FilterFactory ff = CommonFactoryFinder. getFilterFactory(null);
PropertyIsEqualTo cf = ff.equals( ff.property( "color" ), 
ff.literal(colorValue) );

Hope that helps.

-Justin

iceDice wrote:
> Hello guys,
> 
> I try to do something similar like this in GeoTools-2.5.4 but i got errors.
> It seems that i use some deprecated methods.
> 
> FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
> 
> Rule r = sf.createRule();
> 
> CompareFilter cf = ff.createCompareFilter(CompareFilter.COMPARE_EQUALS);
> cf.addLeftValue(ff.createAttributeExpression(f, "colour"));
> cf.addRightValue(sb.literalExpression(colourValue));
> r.setFilter(cf);
> 
> Can someone tell me how to do this on other way in GeoTools-2.5.4?
> 
> Thanks.


-- 
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to