Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type issue when using t_intersects filter #62

Closed
bjgiraudon opened this issue May 22, 2024 · 1 comment · Fixed by #63
Closed

Type issue when using t_intersects filter #62

bjgiraudon opened this issue May 22, 2024 · 1 comment · Fixed by #63

Comments

@bjgiraudon
Copy link

Hi,

I have been using this library for implementing cql-2 filtering in a STAC REST API using the Filters extension.

However, I came across an issue while trying to use the t_intersects filters.

For example with these filters:

{
    "filter-lang": "cql2-json",
    "filter": {
        "op" : "and",
        "args": [
            {
                "op": "=",
                "args" : [ { "property": "collection" }, "COLLECTION.ID" ]
            },
            {
                "op": "t_intersects",
                "args": [
                    { "property": "datetime" },
                    { "interval" : [ "2020-11-11T00:00:00Z", "2020-11-12T00:00:00Z"] }
                ]
            }
        ]
    }
}

It seems that the decodeExpression function interprets the datetimes as strings and returns an error.

The decodeInternal function then returns with an error:

{
    "error": "trouble decoding arg 1 for \"t_intersects\" op: expected date or timestamp expression, got 2020-11-11T00:00:00Z"
}

I will be happy to help if needed, thanks!

@tschaub
Copy link
Member

tschaub commented May 22, 2024

Thanks for the report, @bjgiraudon.

I've addressed this in the v0.11.0 release. See #63 for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants