org.geotools.filter.text.ecql
Class ECQL

java.lang.Object
  extended by org.geotools.filter.text.ecql.ECQL

public class ECQL
extends java.lang.Object

Extended Common Query Language (ECQL) is an extension of CQL. This class presents the operations available to parse the ECQL language and generates the correspondent filter.

Usage

Here are some usage examples. Refer to the complete grammar to see what exactly you can do.
 
       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("ID IN ('river.1', 'river.2')");
       
       Filter filter = ECQL.toFilter("LENGHT IN (4100001,4100002, 4100003 )");

       List <Filter> list = ECQL.toFilterList("LENGHT = 100; NAME like '%omer%'");

       Expression expression = ECQL.toExpression("LENGHT + 100");

 
 

Since:
2.6
Author:
Jody Garnett, Mauricio Pazos (Axios Engineering)

Method Summary
static org.opengis.filter.expression.Expression toExpression(java.lang.String ecqlExpression)
          Parses the input string in ECQL format into an Expression, using the systems default FilterFactory implementation.
static org.opengis.filter.expression.Expression toExpression(java.lang.String ecqlExpression, org.opengis.filter.FilterFactory filterFactory)
          Parses the input string in ECQL format and makes the correspondent Expression , using the provided FilterFactory.
static org.opengis.filter.Filter toFilter(java.lang.String ecqlPredicate)
          Parses the input string in ECQL format into a Filter, using the systems default FilterFactory implementation.
static org.opengis.filter.Filter toFilter(java.lang.String ecqlPredicate, org.opengis.filter.FilterFactory filterFactory)
          Parses the input string in ECQL format into a Filter, using the provided FilterFactory.
static java.util.List<org.opengis.filter.Filter> toFilterList(java.lang.String ecqlSequencePredicate)
          Parses the input string, which has to be a list of ECQL predicates separated by ";" into a List of Filter, using the provided FilterFactory.
static java.util.List<org.opengis.filter.Filter> toFilterList(java.lang.String ecqlSequencePredicate, org.opengis.filter.FilterFactory filterFactory)
          Parses the input string, which has to be a list of ECQL predicates separated by ";" into a List of Filter, using the provided FilterFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toFilter

public static org.opengis.filter.Filter toFilter(java.lang.String ecqlPredicate)
                                          throws CQLException
Parses the input string in ECQL format into a Filter, using the systems default FilterFactory implementation.

Parameters:
ECQLPredicate - a string containing a query predicate in ECQL format.
Returns:
a Filter equivalent to the constraint specified in ecqlPredicate.
Throws:
CQLException

toFilter

public static org.opengis.filter.Filter toFilter(java.lang.String ecqlPredicate,
                                                 org.opengis.filter.FilterFactory filterFactory)
                                          throws CQLException
Parses the input string in ECQL format into a Filter, using the provided FilterFactory.

Parameters:
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.
Returns:
a Filter equivalent to the constraint specified in Predicate.
Throws:
CQLException

toExpression

public static org.opengis.filter.expression.Expression toExpression(java.lang.String ecqlExpression)
                                                             throws CQLException
Parses the input string in ECQL format into an Expression, using the systems default FilterFactory implementation.

Parameters:
ecqlExpression - a string containing an ECQL expression.
Returns:
a Expression equivalent to the one specified in ecqlExpression.
Throws:
CQLException

toExpression

public static org.opengis.filter.expression.Expression toExpression(java.lang.String ecqlExpression,
                                                                    org.opengis.filter.FilterFactory filterFactory)
                                                             throws CQLException
Parses the input string in ECQL format and makes the correspondent Expression , using the provided FilterFactory.

Parameters:
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.
Returns:
a Filter equivalent to the constraint specified in ecqlExpression.
Throws:
CQLException

toFilterList

public static java.util.List<org.opengis.filter.Filter> toFilterList(java.lang.String ecqlSequencePredicate)
                                                              throws CQLException
Parses the input string, which has to be a list of ECQL predicates separated by ";" into a List of Filter, using the provided FilterFactory.

Parameters:
ecqlSequencePredicate - a list of ECQL predicates separated by ";"
Returns:
a List of Filter, one for each input ECQL statement
Throws:
CQLException

toFilterList

public static java.util.List<org.opengis.filter.Filter> toFilterList(java.lang.String ecqlSequencePredicate,
                                                                     org.opengis.filter.FilterFactory filterFactory)
                                                              throws CQLException
Parses the input string, which has to be a list of ECQL predicates separated by ";" into a List of Filter, using the provided FilterFactory.

Parameters:
ecqlSequencePredicate - a ECQL predicate sequence
filterFactory - the factory used to make the filters
Returns:
a List of Filter, one for each input ECQL statement
Throws:
CQLException


Copyright © 1996-2010 Geotools. All Rights Reserved.