microsoft / microsoft/planetary-computer-apis

Search by datetime in CQL Text

Open
#108 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
129
Forks
33
Avg merge
2d 20h
Merged PRs (30d)
1

Description

Describe the bug
As datetime is not supported directly, as seen in #100, I'm now trying to use CQL which was mentioned as alternative.

I want to filter by timestamp on the datetime field, e.g.
https://planetarycomputer.microsoft.com/api/stac/v1/collections/chloris-biomass/items?limit=12&filter-lang=cql2-text&filter=datetime < TIMESTAMP('2010-01-01T01%3A00%3A00.000Z') (also tried the URL encoded variant)

Instead of results that are older than 2010, I also get results that are newer than 2010. It looks like the filter is not taken into account at all.

Is CQL not supported on the items endpoint? Some of the conformance classes around filtering are a bit of a mess in stac-fastapi and stac-api-spec currently, so I'm just guessing...

To reproduce
See above.

Expected behavior
See above.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the CQL2 text request against the items endpoint using the timestamp filter shown in the issue, then inspect the filtering behavior and relevant stac-fastapi or stac-api-spec conformance handling. Done means the query returns only items older than 2010 and URL-encoded and unencoded forms behave consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.