You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/cql.rst
+29-23Lines changed: 29 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,15 +3,18 @@
3
3
CQL support
4
4
===========
5
5
6
+
OGC Common Query Language (`CQL2`_) is a generic language designed to provide enhanced query and subset/filtering to (primarily) feature and record data.
7
+
6
8
Providers
7
9
---------
8
10
9
-
As of now the available providers supported for CQL filtering are limited to :ref:`Elasticsearch <Elasticsearch>` and :ref:`PostgreSQL <PostgreSQL>`.
10
-
11
+
CQL2 support is implemented in various pygeoapi feature and record providers. See the :ref:`feature <ogcapi-features>` and :ref:`metadata <ogcapi-records>` provider sections
12
+
for current provider support.
13
+
11
14
Limitations
12
15
-----------
13
16
14
-
Support of CQL is limited to `Simple CQL filter <https://portal.ogc.org/files/96288#cql-core>`_ and thus it allows to query with the
17
+
Support of CQL is limited to `Basic CQL2 <https://docs.ogc.org/is/21-065r2/21-065r2.html#cql2-core>`_ and thus it allows to query with the
15
18
following predicates:
16
19
17
20
* comparison predicates
@@ -21,20 +24,20 @@ following predicates:
21
24
Formats
22
25
-------
23
26
24
-
At the moment Elasticsearch supports only the CQL dialect with the JSON encoding `CQL-JSON <https://portal.ogc.org/files/96288#simple-cql-JSON>`_.
27
+
Supported providers leverage the CQL2 dialect with the JSON encoding `CQL-JSON <https://docs.ogc.org/is/21-065r2/21-065r2.html#cql2-json>`_.
25
28
26
-
PostgreSQL supports both CQL-JSON and CQL-text dialects, `CQL-JSON <https://portal.ogc.org/files/96288#simple-cql-JSON>`_ and `CQL-TEXT <https://portal.ogc.org/files/96288#simple-cql-text>`_
29
+
PostgreSQL supports both `CQL2 JSON <https://docs.ogc.org/is/21-065r2/21-065r2.html#cql2-json>`_ and `CQL text <https://docs.ogc.org/is/21-065r2/21-065r2.html#cql2-text>`_ dialects.
27
30
28
31
Queries
29
32
^^^^^^^
30
33
31
34
The PostgreSQL provider uses `pygeofilter <https://github.com/geopython/pygeofilter>`_ allowing a range of filter expressions, see examples for:
Note that the CQL text has been URL encoded. This is required in curl commands but when entering in a browser, plain text can be used e.g. ``CROSSES(foo_geom, LINESTRING(28 -2, 30 -4))``.
Copy file name to clipboardExpand all lines: docs/source/development.rst
-38Lines changed: 0 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,44 +22,6 @@ Tests can be run locally as part of development workflow. They are also run on
22
22
To run all tests, simply run ``pytest`` in the repository. To run a specific test file,
23
23
run ``pytest tests/api/test_itemtypes.py``, for example.
24
24
25
-
26
-
CQL extension lifecycle
27
-
-----------------------
28
-
29
-
Limitations
30
-
^^^^^^^^^^^
31
-
32
-
This workflow is valid only for the `CQL-JSON` format.
33
-
34
-
Schema
35
-
^^^^^^
36
-
37
-
The Common Query Language (CQL) is the part 3 of the standard OGC API - Features. This extension has its specification available at
38
-
`OGC API - Features - Part 3: Filtering and the Common Query Language (CQL) <https://portal.ogc.org/files/96288>`_ and the schema exists in development at
pygeoapi uses a class-based Python model interface to translate the schema into Python objects defined by `pydantic <https://docs.pydantic.dev/>`_ models.
45
-
The model is generated with the pre-processing of the schema through the utility ``datamodel-codegen``, which is part
46
-
of the `datamodel-code-generator <https://koxudaxi.github.io/datamodel-code-generator/>`_ package:
Note that datamodel-code-generator must be explicitly installed, as it is not a pygeoapi runtime dependency
55
-
56
-
How to merge
57
-
^^^^^^^^^^^^
58
-
59
-
Once the new pydantic models have been generated then the content of the Python file ``cql_update.py`` can be used to replace the old classes within the ``cql.py`` file.
60
-
Update everything above the function ``get_next_node`` and then verify if the tests for the CQL are still passing, for example ``test_post_cql_json_between_query``
0 commit comments