pygeofilter icon indicating copy to clipboard operation
pygeofilter copied to clipboard

cql2-json between operator fails

Open ka7eh opened this issue 2 years ago • 1 comments

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:

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

pygeofilter expects it to be like this:

{
  "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.

ka7eh avatar Apr 14 '23 12:04 ka7eh

I came here to report this exact same issue!

captaincoordinates avatar Jun 19 '24 21:06 captaincoordinates