Hi Erwan,

I don't think there's an "and" function.  It can be used between two conditions[1].

Cheers,

Jim

1. https://docs.geoserver.org/stable/en/user/filter/ecql_reference.html#condition (I end up referring to this page frequently to figure out syntax.)

2. I also like this page: https://docs.geoserver.org/stable/en/user/tutorials/cql/cql_tutorial.html

On 11/2/2020 5:45 AM, Erwan Bocher wrote:

Based on https://docs.geotools.org/latest/userguide/library/opengis/filter.html , I try to use logical op like this

"if_then_else(and(greaterThan(area(THE_GEOM), 10),equalTo(type, 12)),5, 1)"

return me

Exception in thread "main" org.geotools.filter.text.cql2.CQLException: Encountered 
"and" at line 1, column 14.

Am I doing something wrong?

Best regards

Erwan
Le 02/11/2020 à 10:30, Erwan Bocher a écrit :

Le 02/11/2020 à 10:23, Andrea Aime a écrit :
No, it does not, but you can make it so by modifying FilterToSQL, and then go around and change the database filter capabilities (otherwise the filter splitter will take it out). Well, unless you can ensure every single database supports CASE WHEN with the same syntax. Which seems like it may be true for most, but every time I bet on it, I find a database that does not follow the SQL standard...):

Ok

I will test this change with the H2GIS-Geotools datastore (https://github.com/orbisgis/h2gis-geotools) and share my result when it rocks

Best regards


--
Ingénieur de Recherche CNRS - HDR,
Laboratoire Lab-STICC – UMR 6285
Equipe DECIDE
Institut Universitaire de Technologie de Vannes
8, Rue Montaigne - BP 561 56017 Vannes Cedex
T: +33 2 97 62 64 92
W:https://cv.archives-ouvertes.fr/erwan-bocher
W:http://www.labsticc.fr


_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to