Hi guys,
with the last changes of the GeoTools _expression_ we noticed that the
IsEqualTo and IsNotEqualTo filters fails comparing Feature attributes
of type Long.
We have solved this stupid problem simply by adding those few lines in the evaluate method:
public boolean evaluate(Feature feature) {
Object value1 = eval( expression1, feature );
Object value2 = eval( expression2, feature );
if (value1 instanceof Long) {
value1 = new Integer(((Long)value1).intValue());
}
if (value2 instanceof Long) {
value2 = new Integer(((Long)value2).intValue());
}
return (value1 == null && value2 == null) ||
value1 != null &&
value1.equals( value2 );
}
Maybe you can find a better solution.
Kind regards,
Alessio.
- [Geotools-devel] IsEqualTo filter problem ... Alessio Fabiani
- Re: [Geotools-devel] IsEqualTo filter problem ... Martin Desruisseaux
