geopython / geopython/pygeofilter

cql2-json between operator fails

Open
#72 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
90
Forks
44
PR merge metrics
No merged PRs in 30d

Description

I see in the specs that `between` operator accepts 3 args: property, lower limit, and upper limit.
But pygeofilter cql2_json parser expects two args: property and a list of two values indicating the lower and upper limits.

Here's the example from OGC Specs (https://docs.ogc.org/DRAFTS/21-065.html#advanced-comparison-operators), which fails with pygeofilter:

```json
{
"op": "between",
"args": [
{ "property": "depth" },
100.0,
150.0
]
}
```

pygeofilter expects it to be like this:

```json
{
"op": "between",
"args": [
{ "property": "depth" },
[100.0, 150.0]
]
```

Is this due to changes in specs?
It seems like a straightforward fix here: https://github.com/geopython/pygeofilter/blob/main/pygeofilter/parsers/cql2_json/parser.py#L131.
If it's an actual bug, I can submit a PR.

Contributor guide

Open the contributing guide

Research direction

Start in pygeofilter/parsers/cql2_json/parser.py around line 131 and compare its argument handling with the three-argument OGC example in the issue. The work is done when the supplied JSON form with separate lower and upper values is accepted without breaking the existing parser behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.