gws.lib.cql.params¶
Translate OGC API query parameters to CQL2-Text filters.
Source code: gws.lib.cql.params
Module Contents¶
- gws.lib.cql.params.from_datetime_param(value: str, name: str) str¶
Translate the
datetimeparameter of OGC API Features to a CQL2-Text filter.The value is an instant or an interval, see OGC 17-069r4, 7.15.4. As an extension, dates and timestamps without a time zone are accepted, a date stands for the whole day:
2021-06-15T10:00:00Z name = TIMESTAMP('2021-06-15T10:00:00Z') 2021-06-15 name = DATE('2021-06-15') 2021-06-01/2021-06-30 name >= DATE('2021-06-01') AND name <= DATE('2021-06-30') 2021-06-01/.. name >= DATE('2021-06-01')
- Parameters:
value – The parameter value.
name – The temporal property to filter on.
- Returns:
A CQL2-Text expression, empty if the value does not restrict anything.
- Raises:
ParseError – If the value is invalid.