Skip to content

Open the STAC dialog on sentinel-2-c1-l2a - #1069

Merged
deniial00 merged 1 commit into
opengeos:mainfrom
elpidioassinaturas:fix/1054-s2-c1-default
Oct 28, 2026
Merged

deniial00 merged 1 commit into
opengeos:mainfrom
elpidioassinaturas:fix/1054-s2-c1-default

Conversation

@elpidioassinaturas

@elpidioassinaturas elpidioassinaturas commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The STAC dialog now opens on Earth Search's sentinel-2-c1-l2a instead of the legacy sentinel-2-l2a.

The legacy collection's reflectance bands declare scale: 0.0001, offset: -0.1, but many of its files don't carry the +1000 offset that the -0.1 removes. Read with the declared offset, their reflectance comes out about 0.1 too low, often negative. Collection 1 matches its metadata. The dialog's Sentinel-2 preset and the data cube catalog (#871) already use it, so only the dialog's default and one docs example were left on the legacy collection.

Evidence is in #1054: for tile 23MQQ on 2025-06-07, the red band's mean stored value was 610 in the legacy collection (87% of pixels below 1000) and 1,609 in Collection 1 (none below 1000).

Fixes #1054

Changes

  • crates/ui-egui/src/stacui.rs: State::default starts on sentinel-2-c1-l2a. The existing preset test gets one line for the default.
  • docs/user-guide/web-data.md: the stac.search / stac.addAsset example uses sentinel-2-c1-l2a and a matching item id (S2B_T32TLS_20240727T103439_L2A, same tile and day as the old example). I checked that the item and its scl asset exist on Earth Search.

Choices and limits

  • The legacy collection stays selectable: typing sentinel-2-l2a still works, for scenes not yet reprocessed. Its visual asset and scl classes aren't affected.
  • Values aren't patched in RustGIS. The +1000 depends on each scene's processing baseline and isn't in the item metadata, so a correction would be a guess.
  • docs/installation.md links a Planetary Computer item. That is another provider's sentinel-2-l2a, so it is left as it is.
  • No change to i18n/*.tsv.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Updates
    • The default Sentinel-2 collection is now sentinel-2-c1-l2a.
    • Updated the web data guide’s CLI example to use the Collection 1 collection and item URL.

The legacy sentinel-2-l2a declares raster:bands offset -0.1, but many of
its files lack the +1000 offset that removes, so reflectance read with
the declared offset comes out about 0.1 too low. Collection 1 matches its
metadata, and the Sentinel-2 preset and the data cube catalog already use
it. Switch the web-data guide's stac.search example to it as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 9806bfbb-729d-4a4e-bd66-6b1e2c10f9a2
Commits

Reviewing files that changed from the base of the PR and between 8c80c5b and a9417eb.

Files selected for processing: 2
  • crates/ui-egui/src/stacui.rs
  • docs/user-guide/web-data.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

The STAC dialog now defaults to sentinel-2-c1-l2a. Its preset test asserts this default, and the web-data CLI example uses the same collection and a Collection 1 item URL.

Changes: STAC collection default

Layer / File(s) Summary
Update the default and example
crates/ui-egui/src/stacui.rs, docs/user-guide/web-data.md
The STAC dialog defaults to sentinel-2-c1-l2a. The preset test asserts the default and notes the legacy collection’s offset issue. The CLI example uses the Collection 1 collection and item URL, while retaining the scl asset.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: giswqs

Merge Risk: Minimal · up to a9417

The collection default and example are consistent with the requested update. No merge-blocking issue is identified; merge after normal checks pass.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the primary change: opening the STAC dialog on the sentinel-2-c1-l2a collection.
Description check Passed The description explains the change, rationale, affected files, scope, linked issue, and verification of the replacement item and asset. It does not include a dedicated Testing or UI evidence section,…
Linked Issues check Passed The change satisfies issue #1054. State::default() now uses sentinel-2-c1-l2a. The existing test module asserts this default. The docs/user-guide/web-data.md example updates both the collection …
Out of Scope Changes check Passed The diff contains only the requested default change, its automated test assertion, and the requested documentation example update for issue #1054. No unrelated provider example, localization file, or …
Full details: Description check

Explanation

The description explains the change, rationale, affected files, scope, linked issue, and verification of the replacement item and asset. It does not include a dedicated Testing or UI evidence section, but the description is otherwise complete and the omissions are non-critical for this small change.

Full details: Linked Issues check

Explanation

The change satisfies issue #1054. State::default() now uses sentinel-2-c1-l2a. The existing test module asserts this default. The docs/user-guide/web-data.md example updates both the collection and matching Earth Search item ID. The diff does not patch legacy pixel values, and it does not remove legacy collection selection.

Full details: Out of Scope Changes check

Explanation

The diff contains only the requested default change, its automated test assertion, and the requested documentation example update for issue #1054. No unrelated provider example, localization file, or pixel-value correction changed.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit hops through fields of green,
The new collection joins the scene.
The STAC default is set just right,
Its test keeps watch both day and night.
The scl stays close for readers to find.

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Bugs: None found. The default collection pairs correctly with the default API (State::default sets api to stac::EARTH_SEARCH, and this PR's new collection is on Earth Search). open_preset overwrites collection for the other presets, so the new default cannot leak into them. The sentinel2 preset already used sentinel-2-c1-l2a, and crates/tiles/src/cubes.json already uses Collection 1, so the dialog now agrees with them. Confidence: high.

Security: None found. The diff only changes a string default and docs text. Confidence: high.

Performance: None found. Confidence: high.

Quality: Nit, not posted inline. The new assertion checks State::default() but sits inside presets_open_the_dialog_set_up, which is about presets. It reads fine as written, so moving it is optional. Confidence: medium.

AGENTS.md: Compliant. No unwrap/expect/panic in non-test code, no new user-visible strings (so no tl! or i18n work), no dependencies, no assets. Confidence: high.

Not verified: I had no network access, so I could not check these claims:

Neither is a defect in the diff as written.

Change size

Compared with main (merge base aea3ddc to PR head a9417eb), the whole PR.

Measure Value
Files changed 2 (added 0, modified 2, removed 0, renamed 0)
Size before 95.8 KB (98,071 B)
Size after 96.0 KB (98,277 B)
Total size change +206 B
Path Before After Change
crates/ui-egui/src/stacui.rs 53.8 KB 54.0 KB +194 B
docs/user-guide/web-data.md 42.0 KB 42.0 KB +12 B

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-1069/
Web app https://preview.rustgis.app/pr-1069/app/
Commit a9417eb

GitHub Pages takes a minute or two to publish a new commit.

@deniial00
deniial00 merged commit c961d6e into opengeos:main Oct 28, 2026
18 checks passed
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 this pull request may close these issues.

[Bug]: The STAC dialog starts on Earth Search's legacy sentinel-2-l2a, whose band values don't carry the offset its metadata declares

3 participants