Skip to content

Add LST Super-Resolution (SR2D4) plugin - #48

Open
LeandroGregorio7 wants to merge 19 commits into
opengeos:mainfrom
LeandroGregorio7:main
Open

Add LST Super-Resolution (SR2D4) plugin#48
LeandroGregorio7 wants to merge 19 commits into
opengeos:mainfrom
LeandroGregorio7:main

Conversation

@LeandroGregorio7

@LeandroGregorio7 LeandroGregorio7 commented Aug 9, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

  • New Features

    • Added the lst-super-resolution plugin for enhanced land-surface temperature imagery.
    • Added support for common GeoTIFF image formats and compression methods, including JPEG, LZW, PackBits, Deflate, and Zstandard.
    • Added light and dark theme styling for the plugin controls and panels.
  • Documentation

    • Added third-party license and attribution notices for bundled components.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds the lst-super-resolution plugin manifest and registry entry, complete control and panel styling, GeoTIFF metadata, predictor handling, and bundled decoders for common raster compression and image formats.

Changes

LST super-resolution plugin

Layer / File(s) Summary
Plugin metadata and registration
plugin-registry.json, plugins/lst-super-resolution/plugin.json
Registers lst-super-resolution with its metadata, manifest path, version, author, homepage, and entry file.
Control and panel styling
plugins/lst-super-resolution/style.css
Adds light and dark theme tokens, MapLibre controls, floating panels, forms, actions, status text, utilities, scrollbars, and sidebar layouts.
TIFF metadata and decoder foundation
plugins/lst-super-resolution/basedecoder-BEbFOz03.js, plugins/lst-super-resolution/globals-B9FiI9ma.js
Adds TIFF field and tag metadata, GeoTIFF key mappings, tag resolution, predictor processing, and the asynchronous BaseDecoder abstraction.
Compression and raster codecs
plugins/lst-super-resolution/deflate-jqWMVTm5.js, plugins/lst-super-resolution/lzw-qEVgi16o.js, plugins/lst-super-resolution/packbits-BkVksIAf.js, plugins/lst-super-resolution/raw-CSK_7147.js, plugins/lst-super-resolution/webimage-JdOPiB5x.js, plugins/lst-super-resolution/jpeg-Cld8JONX.js, plugins/lst-super-resolution/zstd-MVmsxGT0.js, plugins/lst-super-resolution/THIRD_PARTY_NOTICES.md
Adds Deflate, LZW, PackBits, raw, WebImage, JPEG, and Zstandard decoders. Documents bundled dependency licenses and notices.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant BaseDecoder
  participant RasterDecoder
  participant CodecRuntime
  BaseDecoder->>RasterDecoder: decode(buffer)
  RasterDecoder->>CodecRuntime: decodeBlock(buffer)
  CodecRuntime-->>RasterDecoder: return decoded bytes
  RasterDecoder-->>BaseDecoder: apply predictor and return buffer
Loading

Possibly related PRs

Poem

A rabbit hops through pixels bright,
Decoding tiles from dark to light.
TIFF tags march, compressors sing,
New panels bloom beside the spring.
The super-resolution plugin takes wing!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the addition of the LST Super-Resolution plugin, which is the primary change.
Docstring Coverage ✅ Passed Docstring coverage is 87.10% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@plugin-registry.json`:
- Line 106: Correct the Portuguese description value in the plugin registry by
replacing the misspelled “espcial” term with “espacial”; leave the rest of the
description unchanged.

In `@plugins/lst-super-resolution/index.js`:
- Around line 202-244: Replace the remaining GeoLibre template implementation
with the LST Super-Resolution SR2D4 workflow: update openFiles/loadFromUrl to
accept and process LST inputs and render the result, replace the demo panels and
Template toolbar menu with LST SR2D4 controls and result views, set the control
title to the manifest’s LST plugin name, and update plugin identity fields to
the manifest values. In plugins/lst-super-resolution/index.js lines 202-244,
implement the input/processing/map-render flow; lines 464-593, replace the demo
UI; lines 637-645, update the title; and lines 657-661, set plugin.id,
plugin.name, and plugin.version and namespace host registration IDs under
lst-super-resolution.
- Around line 123-129: Update setState() to render the merged state on the
mounted panel: synchronize its width and expanded class after assigning _state,
and recalculate the panel position when the restored state is expanded. Preserve
the existing statechange emission and use the panel’s established
rendering/positioning methods.
- Around line 690-698: Update setMapControlPosition so the existing position is
preserved until app.addMapControl succeeds; when reattachment fails, restore or
retain that previous position while preserving the pending-state cleanup, and
commit nextPosition only after a successful add.

In `@plugins/lst-super-resolution/style.css`:
- Around line 196-213: Increase the text contrast for the .plugin-control-action
button by updating its color or accent token in the source stylesheet
src/lib/styles/plugin-control.css, not the generated plugin stylesheet; ensure
the normal button state meets a 4.5:1 contrast ratio and regenerate the bundle
afterward.
- Around line 77-90: Add a visible :focus-visible focus indicator for
.plugin-control-toggle in src/lib/styles/plugin-control.css, replacing the
removed outline for keyboard users while preserving the existing control
styling. Regenerate the Vite bundle so the corresponding generated
plugins/*/style.css output is updated.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f412b7d5-cdf1-4721-a300-5ed80ed35fa9

📥 Commits

Reviewing files that changed from the base of the PR and between fa32398 and 5508558.

📒 Files selected for processing (4)
  • plugin-registry.json
  • plugins/lst-super-resolution/index.js
  • plugins/lst-super-resolution/plugin.json
  • plugins/lst-super-resolution/style.css

Comment thread plugin-registry.json Outdated
{
"id": "lst-super-resolution",
"name": "LST Super-Resolution (SR2D4)",
"description": "Downscaling espacial avançado (TsHARP) da temperatura de superfície Landsat (100m para 1m) utilizando Sentinel SR2D4 com análise estatística de Ilhas de Calor (UHI).",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Correct the Portuguese description.

Replace espcial with espacial.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugin-registry.json` at line 106, Correct the Portuguese description value
in the plugin registry by replacing the misspelled “espcial” term with
“espacial”; leave the rest of the description unchanged.

Comment on lines +123 to +129
setState(newState) {
this._state = {
...this._state,
...newState
};
this._emit("statechange");
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Render accepted state changes.

applyProjectState() calls setState() for an active control at lines 703-706. setState() only changes _state. The mounted panel keeps its old width and expanded state.

Update the panel width and expanded class after merging state. Recalculate the panel position when the restored state is expanded.

Proposed fix
 setState(newState) {
   this._state = {
     ...this._state,
     ...newState
   };
+  if (this._panel) {
+    this._panel.style.width = `${this._state.panelWidth}px`;
+    this._panel.classList.toggle("expanded", !this._state.collapsed);
+    if (!this._state.collapsed) this._updatePanelPosition();
+  }
   this._emit("statechange");
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
setState(newState) {
this._state = {
...this._state,
...newState
};
this._emit("statechange");
}
setState(newState) {
this._state = {
...this._state,
...newState
};
if (this._panel) {
this._panel.style.width = `${this._state.panelWidth}px`;
this._panel.classList.toggle("expanded", !this._state.collapsed);
if (!this._state.collapsed) this._updatePanelPosition();
}
this._emit("statechange");
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/lst-super-resolution/index.js` around lines 123 - 129, Update
setState() to render the merged state on the mounted panel: synchronize its
width and expanded class after assigning _state, and recalculate the panel
position when the restored state is expanded. Preserve the existing statechange
emission and use the panel’s established rendering/positioning methods.

Comment thread plugins/lst-super-resolution/index.js
Comment on lines +690 to +698
setMapControlPosition(app, nextPosition) {
position = nextPosition;
if (!control) return;
app.removeMapControl(control);
if (!app.addMapControl(control, position)) {
pendingState = control.getState();
control = null;
return false;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Restore the previous position when reattachment fails.

Line 691 stores nextPosition before app.addMapControl() succeeds. If line 694 fails, getMapControlPosition() and the next activation keep the rejected position. The plugin can remain unavailable until another caller changes it.

Commit position only after a successful add, or restore the previous value on failure.

Proposed fix
 setMapControlPosition(app, nextPosition) {
-  position = nextPosition;
   if (!control) return;
+  const previousPosition = position;
   app.removeMapControl(control);
-  if (!app.addMapControl(control, position)) {
+  if (!app.addMapControl(control, nextPosition)) {
+    position = previousPosition;
     pendingState = control.getState();
     control = null;
     return false;
   }
+  position = nextPosition;
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/lst-super-resolution/index.js` around lines 690 - 698, Update
setMapControlPosition so the existing position is preserved until
app.addMapControl succeeds; when reattachment fails, restore or retain that
previous position while preserving the pending-state cleanup, and commit
nextPosition only after a successful add.

Comment thread plugins/lst-super-resolution/style.css Outdated
Comment on lines +77 to +90
/* Toggle button - 29x29 to match navigation control */
.plugin-control-toggle {
background: none;
border: none;
padding: 0;
width: 29px;
height: 29px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
outline: none;
color: var(--pc-icon);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Restore a visible keyboard-focus indicator.

Line 88 removes the browser focus outline. The toggle button has no :focus or :focus-visible replacement. Keyboard users cannot identify the focused control.

Add a visible :focus-visible style in the template stylesheet, then regenerate this bundle. Based on learnings, plugins/*/style.css is generated Vite output, so update src/lib/styles/plugin-control.css instead of editing this file directly.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/lst-super-resolution/style.css` around lines 77 - 90, Add a visible
:focus-visible focus indicator for .plugin-control-toggle in
src/lib/styles/plugin-control.css, replacing the removed outline for keyboard
users while preserving the existing control styling. Regenerate the Vite bundle
so the corresponding generated plugins/*/style.css output is updated.

Source: Learnings

Comment thread plugins/lst-super-resolution/style.css Outdated
Comment on lines +196 to +213
.plugin-control-action {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 8px 16px;
font-size: 14px;
font-weight: 500;
color: white;
background: var(--pc-accent);
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.15s;
}

.plugin-control-action:hover {
background: var(--pc-accent-hover);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Increase action-button text contrast.

White text on --pc-accent: #4a90d9`` has about 3.3:1 contrast. The button text is 14px, so it does not meet the common 4.5:1 minimum. Use an accessible accent token or a darker text color.

Make the change in the template stylesheet and regenerate this bundle. Based on learnings, plugins/*/style.css is generated Vite output, so update src/lib/styles/plugin-control.css instead of editing this file directly.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/lst-super-resolution/style.css` around lines 196 - 213, Increase the
text contrast for the .plugin-control-action button by updating its color or
accent token in the source stylesheet src/lib/styles/plugin-control.css, not the
generated plugin stylesheet; ensure the normal button state meets a 4.5:1
contrast ratio and regenerate the bundle afterward.

Source: Learnings

@giswqs

giswqs commented Aug 10, 2026

Copy link
Copy Markdown
Member

/claude-review

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://opengeos.org/pages-preview/geolibre-plugins/pr-48/

Built to branch gh-pages at 2026-08-21 14:08 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@plugins/lst-super-resolution/zstd-MVmsxGT0.js`:
- Around line 134-145: Document the provenance and licenses for all nine
committed generated chunks: in
plugins/lst-super-resolution/zstd-MVmsxGT0.js:134-145 record the exact zstddec
version, preserve/surface the Zstandard BSD license in plugin distribution
metadata, and either generate this output during the build or retain the
documented vendoring; in
plugins/lst-super-resolution/basedecoder-BEbFOz03.js:1-115 record the geotiff
version for predictor.js and basedecoder.js; in
plugins/lst-super-resolution/globals-B9FiI9ma.js:1-23 record the bundler and
geotiff versions; and in plugins/lst-super-resolution/jpeg-Cld8JONX.js:1-2,
lzw-qEVgi16o.js:1-2, packbits-BkVksIAf.js:1-2, raw-CSK_7147.js:1-2, and
webimage-JdOPiB5x.js:1-2 record their geotiff origin. For
plugins/lst-super-resolution/deflate-jqWMVTm5.js:1-2 also record the bundled
pako license. If source builds are available, replace committed artifacts with
build-generated chunks.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 92113681-6089-4abe-9eef-40827f7ec6c2

📥 Commits

Reviewing files that changed from the base of the PR and between 620ca83 and 1e483ed.

📒 Files selected for processing (12)
  • plugins/lst-super-resolution/basedecoder-BEbFOz03.js
  • plugins/lst-super-resolution/deflate-jqWMVTm5.js
  • plugins/lst-super-resolution/globals-B9FiI9ma.js
  • plugins/lst-super-resolution/index.js
  • plugins/lst-super-resolution/jpeg-Cld8JONX.js
  • plugins/lst-super-resolution/lerc-DB9wtJoF.js
  • plugins/lst-super-resolution/lzw-qEVgi16o.js
  • plugins/lst-super-resolution/packbits-BkVksIAf.js
  • plugins/lst-super-resolution/pako.esm-Bh1yUGpp.js
  • plugins/lst-super-resolution/raw-CSK_7147.js
  • plugins/lst-super-resolution/webimage-JdOPiB5x.js
  • plugins/lst-super-resolution/zstd-MVmsxGT0.js

Comment thread plugins/lst-super-resolution/zstd-MVmsxGT0.js

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@plugins/lst-super-resolution/THIRD_PARTY_NOTICES.md`:
- Line 10: Add the required Zlib attribution to THIRD_PARTY_NOTICES.md alongside
the pako dependency entry, including the full Zlib license text and copyright
notice for Jean-loup Gailly and Mark Adler.
- Around line 7-11: Update the bundled dependency inventory in
THIRD_PARTY_NOTICES.md using build metadata’s resolved versions, including a new
lerc entry and the bundled pako@2.2.0 and Zstandard versions rather than
package-lock resolutions. Change pako’s license to “MIT AND Zlib,” and add the
LERC Apache-2.0 notice plus the complete BSD 3-Clause Zstandard license text
with all required copyright notices.
- Around line 15-25: Add the missing bundled third-party license notices and
attributions to THIRD_PARTY_NOTICES.md: include copyright notices for geotiff,
pako, and zstddec; pako’s required Zlib license and attribution; the complete
zstddec BSD-3-Clause text with clause 3 and the Zstandard copyright notice; and
the Apache 2.0 notice for bundled Esri LERC code. Preserve the existing notice
formatting.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1e2e37e5-3bfd-4e0a-a8ba-9682b1c1f814

📥 Commits

Reviewing files that changed from the base of the PR and between 1e483ed and b4f5b66.

📒 Files selected for processing (1)
  • plugins/lst-super-resolution/THIRD_PARTY_NOTICES.md

Comment thread plugins/lst-super-resolution/THIRD_PARTY_NOTICES.md Outdated
Comment thread plugins/lst-super-resolution/THIRD_PARTY_NOTICES.md Outdated
Comment thread plugins/lst-super-resolution/THIRD_PARTY_NOTICES.md
Removed extensive comments and styles for plugin control, and added third-party notices and license information.
Updated the version of Vite and added new bundled files to the third-party notices. Expanded the Apache License section with detailed definitions and terms.
@giswqs

giswqs commented Aug 14, 2026

Copy link
Copy Markdown
Member

The plugin failed CI tests. Can you fix them?

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.

2 participants