Shortcuts

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

static eq(property, value)[source]

filter on equality between a property and a value

static neq(property, value)[source]

filter on no equality between a property and a value

static gt(property, value)[source]

filter that a property is greater than a value

static gte(property, value)[source]

filter that a property is greater than or equal to a value

static lt(property, value)[source]

filter that a property is less than a value

static lte(property, value)[source]

filter that a property is less than or equal to a value

static logical_and(*args)[source]

filter that combines multiple filters with a logical and

static logical_or(*args)[source]

filter that combines multiple filters with a logical or

static logical_not(filter)[source]

filter that negates another filter

static like(property, value)[source]

filter that checks for text similarity

static isin(property, value)[source]

filter that checks for items in an array/list

static isnull(property)[source]

filter that checks that a field is null

static between(property, a, b)[source]

filter that checks that a property is between two values

Docs

Developer documentation for Seer AI APIs

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources