Skip to content

CQL2-TEXT keywords are case sensitive #2015

Open
@sebastianfrey

Description

@sebastianfrey

Description

Keywords like AND, OR, IN, etc. are are evaluated case-sensitive when used within a CQL2 text filter.

Steps to Reproduce

Create a filter with lower-case keywords such as the following one:

gemarkung_id = 870 and flurnummer = 0

Sample: https://ogcapi-test.lgl-bw.de/pygeoapi/collections/flurstueck/items?f=json&filter=gemarkung_id=870%20AND%20flurnummer=0

This will fail with:

{
    "code":"InvalidParameterValue",
    "type":"InvalidParameterValue",
    "description":"Bad CQL text"
}

Now create a filter with upper-case keywords such as the following one:

gemarkung_id = 870 AND flurnummer = 0

Sample: https://ogcapi-test.lgl-bw.de/pygeoapi/collections/flurstueck/items?f=json&filter=gemarkung_id=870%20AND%20flurnummer=0

This works as expected.

Expected behavior
As stated in the CQL specification https://portal.ogc.org/files/96288#cql-text Keywords in the BNF grammar are case-insensitive.

So I would expect, pygeoapi to evaluate keywords like AND, OR, IN, etc. case-insensitive.

Screenshots/Tracebacks

Environment

  • OS: -
  • Python version: -
  • pygeoapi version: 0.19.0

Additional context
I already raised an issue in geopython/pygeofilter#121, because I thought at first that this module was causing the error. But as pointed out by @jrobinson-spk, it looks like the cause of the problem resides in pygeoapi.

If you need any further information or additional context, please let me know.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions