OAPIF: CQL layer filter expression is not used in request #60092
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
Data Provider
Related to specific vector, raster or mesh data providers
What is the bug or the crash?
I am trying to figure out what options exist to spatially filter OAPIF layers and how to write the expressions.
Probably I am using things wrong, but it seems to me that a valid filter expression is not actually used in the request to the server.
I have tried with examples from the tests. In https://github.com/qgis/QGIS/blob/0984ab8d9bcef608a4a8b2c840fafebeb1b1ca68/tests/src/python/test_provider_oapif.py many filter strings are defined and set to the test layer with
.setSubsetString()
below.For example
QGIS/tests/src/python/test_provider_oapif.py
Lines 1376 to 1377 in 0984ab8
and
QGIS/tests/src/python/test_provider_oapif.py
Lines 1380 to 1381 in 0984ab8
If I use those strings as layer filter "subset string" (via GUI or Python) they are nowhere to be found in the logged network requests.
I am testing with the endpoint https://ogc-api.geobasis-bb.de/datasets/vg/collections/bz in EPSG:4326
Steps to reproduce the issue
Case 1:
intersects_bbox
andPOLYGON
intersects_bbox($geometry, geomFromWkt('POLYGON((-180 -90,-180 90,180 90,180 -90,-180 -90))'))
results in e.g.https://ogc-api.geobasis-bb.de/datasets/vg/collections/bz/items?limit=100&bbox=50.57793710916428154,4.66530253396964145,54.41790023316391967,16.90450532457161259&bbox-crs=http://www.opengis.net/def/crs/EPSG/0/4326&crs=http://www.opengis.net/def/crs/EPSG/0/4326 and no relevant headers.
According to the tests there is some magical BBOX conversion and
S_INTERSECTS(geometry,BBOX(-180,-90,180,90))&filter-lang=cql2-text
should appear in the URL.Case 2:
intersects
andPOINT
intersects($geometry, geomFromWkt('POINT(-70.5 66.5))'))
results in e.g. https://ogc-api.geobasis-bb.de/datasets/vg/collections/bz/items?limit=100&bbox=48.16256830302904035,3.03290265805188319,51.09329552211858783,9.15250405335286921&bbox-crs=http://www.opengis.net/def/crs/EPSG/0/4326&crs=http://www.opengis.net/def/crs/EPSG/0/4326 and no relevant headers.According to the tests,
filter=S_INTERSECTS(geometry,POINT(-70.5%2066.5))&filter-lang=cql2-text
should have been appended to the URL.While the BBOX magic in the query above might have lead to some "correct but hard to understand" result before, in this case there is a simple POINT and this should definitely be passed, right?
Versions
Supported QGIS version
New profile
Additional context
The text was updated successfully, but these errors were encountered: