Skip to content

Commit 30baec6

Browse files
committed
normalize CQL text support to CQL2 (#2015)
1 parent 1eb24cb commit 30baec6

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

docs/source/cql.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
.. _cql:
1+
.. _cql2:
22

3-
CQL support
4-
===========
3+
CQL2 support
4+
============
55

66
OGC Common Query Language (`CQL2`_) is a generic language designed to provide enhanced query and subset/filtering to (primarily) feature and record data.
77

@@ -14,7 +14,7 @@ for current provider support.
1414
Limitations
1515
-----------
1616

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
17+
Support 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
1818
following predicates:
1919

2020
* comparison predicates
@@ -24,9 +24,9 @@ following predicates:
2424
Formats
2525
-------
2626

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>`_.
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>`_.
2828

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.
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.
3030

3131
Queries
3232
^^^^^^^
@@ -83,7 +83,7 @@ Or
8383
]
8484
}'
8585
86-
The same ``BETWEEN`` query using HTTP GET request formatted as CQL text and URL encoded as below:
86+
The same ``BETWEEN`` query using HTTP GET request formatted as CQL2 text and URL encoded as below:
8787

8888
.. code-block:: bash
8989
@@ -103,7 +103,7 @@ An ``EQUALS`` example for a specific property:
103103
]
104104
}'
105105
106-
A ``CROSSES`` example via an HTTP GET request. The CQL text is passed via the ``filter`` parameter.
106+
A ``CROSSES`` example via an HTTP GET request. The CQL2 text is passed via the ``filter`` parameter.
107107

108108
.. code-block:: bash
109109
@@ -122,6 +122,6 @@ The same example, but this time providing a geometry in EWKT format:
122122
123123
curl "http://localhost:5000/collections/beni/items?filter=DWITHIN(geometry,SRID=3857;POINT(1392921%205145517),100,meters)"
124124
125-
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))``.
125+
Note that the CQL2 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))``.
126126

127127
.. _`CQL2`: https://docs.ogc.org/is/21-065r2/21-065r2.html

pygeoapi/api/itemtypes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
from typing import Any, Tuple, Union, Optional
4444
import urllib.parse
4545

46-
from pygeofilter.parsers.ecql import parse as parse_ecql_text
46+
from pygeofilter.parsers.cql2_text import parse as parse_cql2_text
4747
from pygeofilter.parsers.cql2_json import parse as parse_cql2_json
4848
from pyproj.exceptions import CRSError
4949

@@ -477,7 +477,7 @@ def get_collection_items(
477477

478478
if cql_text is not None:
479479
try:
480-
filter_ = parse_ecql_text(cql_text)
480+
filter_ = parse_cql2_text(cql_text)
481481
filter_ = modify_pygeofilter(
482482
filter_,
483483
filter_crs_uri=filter_crs_uri,

tests/test_postgresql_provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
import pyproj
4747
from http import HTTPStatus
4848

49-
from pygeofilter.parsers.ecql import parse
49+
from pygeofilter.parsers.cql2_text import parse
5050

5151
from pygeoapi.api import API
5252
from pygeoapi.api.itemtypes import (

tests/test_util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Authors: Tom Kralidis <tomkralidis@gmail.com>
44
#
5-
# Copyright (c) 2021 Tom Kralidis
5+
# Copyright (c) 2025 Tom Kralidis
66
#
77
# Permission is hereby granted, free of charge, to any person
88
# obtaining a copy of this software and associated documentation
@@ -38,7 +38,7 @@
3838
import pytest
3939
from pyproj.exceptions import CRSError
4040
import pygeofilter.ast
41-
from pygeofilter.parsers.ecql import parse
41+
from pygeofilter.parsers.cql2_text import parse
4242
from pygeofilter.values import Geometry
4343
from shapely.geometry import Point
4444

0 commit comments

Comments
 (0)