CQLFilter¶
- class geodesic.cql.CQLFilter(*args, **kwargs)[source]¶
Bases:
geodesic.bases._APIObject
Represents an OGC CQL2 Filter.
The CQL2 standard is documented on the OGC’s github repo for the OGC API Features: https://github.com/opengeospatial/ogcapi-features/blob/master/cql2/standard/schema
CQL2 is a way to filter tabular datasets such as features and STAC items. In Geodesic, we use CQL2 as the universal filtering language and it’s converted internally to the needed filtering format.
CQLFilter has only two keyword arguments, op and args, described below.
- Parameters
op – the name/id for the operation
args – a list of arguments for that operation
Filters can be composed of multiple filters using the and/or ops.
Examples: >>> from geodesic.cql import CQLFilter as C
# filter a dataset for all items that have a value of “ASCENDING” for the field “properties.orbit” >>> filter = C.eq(“properties.orbit”, “ASCENDING”)
# filter a dataset for all items that have a value of “ASCENDING” for the field “properties.orbit” # and a value of “properties.angle” of less than 45.0 >>> filter = C.and(C.eq(“properties.orbit”, “ASCENDING”), C.lt(“properties.angle”, 45.0))
# Directly create a CQLFilter using CQL syntax. This is for items with a field “a” and a value equal to “b” >>> from geodesic.cql import CQLFilter >>> filter = CQLFilter(op=”=”, args=[{“property”: “a”}, “b”])
- op¶
(str) - the operation this filter implements
Descriptor:
_StringDescr
- args¶
arguments to this operation
Descriptor:
_ListDescr