Is there a java library for converting ECQL(geotools) to SQL ?
CQL and ECQL CQL (Common Query Language) is a query language created by the OGC for the Catalogue Web Services specification.
GeoTools can convert most (many?) filter
objects to SQL before sending them to a JDBCDatastore
but it usually depends on which database you are targetting. See, for example, org.geotools.data.postgis.PostgisFilterToSQL
- you could do something like:
Filter filter = EQCL.toFilter("My filter goes here");
FilterToSQL encoder = new PostgisFilterToSQL(new PostGISDialect(null));
encoder.setInline(true); // don't adding WHERE
String sql = encoder.encodeToString(filter);