org.geolatte.common.cql.package.html Maven / Gradle / Ivy
Show all versions of geolatte-common Show documentation
This package contains the implementation of a CQL parser and a number of utility classes. CQL - Common Query Language - is described in the OGC OpenGIS Catalogue Services Specification.
Our implementation does implement the described CQL syntax completely and may deviate in some places. This is mainly because the standard does not seems to be 100% finished and contains a few strange decisions.
CQL Examples
General Comparisons
A > 1
B >= 2
C < 3
D <= 4
E = 5
F <> 6
Date Comparisons
(dateformat = yyyy-mm-ddThh:mm:ss)
DateAttr BEFORE 2010-05-05T12:56:35
DateAttr AFTER 2010-11-05T12:56:35
Text Comparisons
The % sign can be used as a wildcard.
A LIKE 'geo%tte'
B NOT LIKE 'something%thing'
Existence operations
Check whether a property is present to enable so-called loose queries.
A EXISTS
B DOES-NOT-EXIST
Boolean Operators
expr1 AND expr2
expr1 OR expr2
NOT expr
API
This package contains a SableCC-generated parser. While the parser classes are publicly accessible, most clients will not (want to) use them directly.
The most important class is the CQL class. It contains methods to convert a CQL string into an executable filter. For example:
import org.geolatte.core.expressions.Filter;
Filter myFilter = CQL.toFilter("(A > 42)");
boolean passedFilter = myFilter.evaluate(anObject);
Extension