Loader: make the eo:cloud_cover filter optional (it removes all Sentinel-1 items)

Open
#149 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

Research direction

Start with app/algorithms/base/loader.py and trace how RUN_CONFIG.cloudCover becomes the load_collection properties and parameters. Check code-runner.ts and the run configuration UI to see whether they send a cloud cover value for collections without eo:cloud_cover. Verify that Sentinel-2 graphs still include their configured filter and that collections without the value load without one.

Written by the indexing model from the issue text.

Description

Problem

app/algorithms/base/loader.py always adds an eo:cloud_cover property filter to load_collection:

default_cloud_cover_max = RUN_CONFIG.get("cloudCover", 20)
...
properties={"eo:cloud_cover": {"process_graph": {"cc": {"process_id": "lt", ...}}}}

A scene without cloudCover still gets the filter: code-runner.ts sends cloudCover: undefined, which JSON.stringify drops, so the loader uses the default 20.

Collections with no eo:cloud_cover property thus return no items. Sentinel-1 GRD and RTC are examples, and also DEMs, land cover and most non-optical collections. titiler-openeo sends the filter to the STAC API as CQL2, and the STAC API removes every item that does not have the property.

Example on Planetary Computer, sentinel-1-grd, bbox [-0.5, 39.2, -0.2, 39.5], 2024-10-25 to 2024-11-05:

Search Items
No filter 5
eo:cloud_cover < 20 0

This blocks Sentinel-1 sample scenes, for example the openeo-udp urban_areas and flood_mapping UDPs. We want to add these on the MPC deployment.

Proposal

Add the filter only when the run config has a cloud cover value:

  • In loader.py, read RUN_CONFIG.get("cloudCover") with no default. When the value is None, call load_collection without properties, and leave cloud_cover_max out of parameters.
  • The existing Sentinel-2 scenes already set cloudCover, so their graphs do not change.
  • Check that the run configuration UI does not always send a cloud cover value. If it does, it should send none for collections that do not have eo:cloud_cover.

Another possible approach: decide from the collection metadata (eo:cloud_cover in summaries or item_assets). The first approach is simpler and is enough for sample scenes.

Note

Today, a scene without cloudCover gets a filter of 20 % without notice. With this change, it gets no filter. I do not know of a scene that depends on the current default.

Dominant language
TypeScript
Stars
11
Forks
0
Avg merge
2d 11h
Merged PRs (30d)
7

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

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.

More from developmentseed/openeo-studio

All issues in developmentseed/openeo-studio

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.