Hi all,

Still exploring the Geotools CQL parser, I wonder if it would be interesting to support alias for expression.

I think of something like this

Expression expr = ECQL.toExpression("X + 1  as newField");

This would allow the user to specify in the text expression the name of the expected column.

Geotools could then easily convert this into a list of definitions that would be passed to the TransformFactory (transform method).

We can imagine a simplification of the method like this :

Expression expr = ECQL.toExpression("X + 1  as newField")

FeatureSource  newFs = TransformFactory.transform(fs, fs.getName(), exp)

or

Expression[] exprs = ECQL.toExpressions("X + 1  as newField, area(the_geom)/1000 as area")

FeatureSource  newFs = TransformFactory.transform(fs, fs.getName(), exps)

or

FeatureSource  newFs = TransformFactory.transform(fs, fs.getName(), "X + 1  as newField, area(the_geom)/1000 as area")


Does this make sense?

Erwan

--
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

Reply via email to