andrea antonello ha scritto: > I am wondering if it is possible to extract through CQL all the > features in which an attribute divided by a number returns 0. > > After browsing the cql functions I tried something like: > > cqlStr = "if_then_else(cat % 2 == 0, true, false)" > Filter cqlFilter = CQL.toFilter(cqlStr); > > new Fc = fc.subCollection(cqlFilter);
My guess is, there is % operator in the OGC filter specification, so the above cannot be properly translated. I guess you have to introduce first a FilterFunction_modulus that computes the rest of the division and then you can do something like modulus(cat, 2) = 0 (no need for if_then_else) Alternatively, and without introducing a new function, this should work too: cat - floor((cat / 2)) * 2 = 0 Cheers Andrea -- Andrea Aime OpenGeo - http://opengeo.org Expert service straight from the developers. ------------------------------------------------------------------------------ _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
