public class ECQL extends Object
Filter filter = ECQL.toFilter("POP_RANK > 6");
Filter filter = ECQL.toFilter("POP_RANK > 3 AND POP_RANK < 6");
Filter filter = ECQL.toFilter("area(the_geom) > 3000");
Filter filter = ECQL.toFilter("Name LIKE '%omer%'");
Filter filter = ECQL.toFilter("RELATE( the_geom1,the_geom2) like 'T**F*****'");
Filter filter = ECQL.toFilter("DISJOINT(buffer(the_geom, 10) , POINT(1 2))");
Filter filter = ECQL.toFilter("IN ('river.1', 'river.2')");
Filter filter = ECQL.toFilter("LENGTH IN (4100001,4100002, 4100003 )");
List <Filter> list = ECQL.toFilterList("LENGTH = 100; NAME like '%omer%'");
Expression expression = ECQL.toExpression("LENGTH + 100");
The reverse process is possible too. To generate the ECQL associated to a filter you should use
the toCQL(...) methods.Modifier and Type | Method and Description |
---|---|
static boolean |
isEwktEncodingEnabled()
Convenience method checking if EWKT encoding should be enabled in ECQL, or not
|
static void |
main(String[] args)
Command line expression tester used to try out filters and expressions.
|
static String |
toCQL(Expression expression)
Generates the expression text associated to the
Expression object. |
static String |
toCQL(Filter filter)
Generates the ecql predicate associated to the
Filter object. |
static String |
toCQL(List<Filter> filterList)
|
static Expression |
toExpression(String ecqlExpression)
Parses the input string in ECQL format into an Expression, using the systems default
FilterFactory implementation. |
static Expression |
toExpression(String ecqlExpression,
FilterFactory filterFactory)
Parses the input string in ECQL format and makes the correspondent Expression , using the
provided FilterFactory.
|
static Filter |
toFilter(String ecqlPredicate)
Parses the input string in ECQL format into a Filter, using the systems default FilterFactory
implementation.
|
static Filter |
toFilter(String ecqlPredicate,
FilterFactory filterFactory)
Parses the input string in ECQL format into a Filter, using the provided FilterFactory.
|
static List<Filter> |
toFilterList(String ecqlSequencePredicate)
|
static List<Filter> |
toFilterList(String ecqlSequencePredicate,
FilterFactory filterFactory)
|
public static Filter toFilter(String ecqlPredicate) throws CQLException
ecqlPredicate
- a string containing a query predicate in ECQL format.Filter
equivalent to the constraint specified in ecqlPredicate
.CQLException
public static Filter toFilter(String ecqlPredicate, FilterFactory filterFactory) throws CQLException
ecqlPredicate
- a string containing a query predicate in ECQL format.filterFactory
- the FilterFactory
to use for the creation of the Filter. If it
is null the method finds the default implementation.Filter
equivalent to the constraint specified in Predicate
.CQLException
public static Expression toExpression(String ecqlExpression) throws CQLException
FilterFactory
implementation.ecqlExpression
- a string containing an ECQL expression.Expression
equivalent to the one specified in ecqlExpression
.CQLException
public static Expression toExpression(String ecqlExpression, FilterFactory filterFactory) throws CQLException
ecqlExpression
- a string containing a ECQL expression.filterFactory
- the FilterFactory
to use for the creation of the Expression. If
it is null the method finds the default implementation.Filter
equivalent to the constraint specified in ecqlExpression
.CQLException
public static List<Filter> toFilterList(String ecqlSequencePredicate) throws CQLException
;
" into a List
of Filter
, using the provided FilterFactory.ecqlSequencePredicate
- a list of ECQL predicates separated by ";
"Filter
, one for each input ECQL statementCQLException
public static List<Filter> toFilterList(String ecqlSequencePredicate, FilterFactory filterFactory) throws CQLException
;
" into a List
of Filter
, using the provided FilterFactory.ecqlSequencePredicate
- a ECQL predicate sequencefilterFactory
- the factory used to make the filtersFilter
, one for each input ECQL statementCQLException
public static String toCQL(Filter filter)
Filter
object.public static boolean isEwktEncodingEnabled()
public static String toCQL(Expression expression)
Expression
object.public static final void main(String[] args)
Copyright © 1996–2023 Geotools. All rights reserved.