Repository navigation
feat: add weighted Brovey pansharpening - #247
Conversation
Sharpen real panchromatic and spectral images in pure Rust with native-type interpolation, weights, selected output bands, nodata, bit depth and footprint adjustment. Expose the materialized operation through CLI/MCP, Python and WebAssembly and compare real Landsat pairs with GDAL.
# Conflicts: # docs/testing.md
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 41 minutes. View limit details
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Core operation and Rust API crates/terrio/src/ops/pansharpen.rs, crates/terrio/src/ops/vrt.rs, crates/terrio/src/ops/mod.rs, crates/terrio/NOTICE, docs/rust.md |
Adds public pansharpening types and an operation with input validation, extent adjustment, spectral resampling, nodata handling, and weighted Brovey output. Adds Rust tests and GDAL attribution. |
CLI and MCP integration crates/terrio-cli/src/cmd/*, crates/terrio-cli/src/lib.rs, crates/terrio-cli/tests/mcp.rs, docs/cli.md |
Adds the pansharpen CLI command, parses its inputs and options, runs the operation, and writes the result. Adds MCP integration coverage and CLI documentation. |
Python and JavaScript bindings python/src/terrain.rs, python/src/ops.rs, python/python/terrio/*, python/tests/test_pansharpen.py, js/src/ops.rs, js/tests/node.test.mjs, docs/python.md, docs/javascript.md |
Adds Python and JavaScript entry points, flattens spectral raster bands into operation inputs, and exposes the Python function through package exports and type stubs. Adds binding tests and examples. |
GDAL comparison and conformance scripts/compare_pansharpen_with_gdal.py, scripts/conformance.py, scripts/fetch_test_data.sh, docs/testing.md |
Adds Landsat fixtures and comparisons covering resampling, weights, output bands, bit depth, nodata, masks, and extent adjustment. Registers a pansharpening conformance suite. |
Priority:
Estimated code review effort: 4 (Complex) | ~50 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant PythonCaller
participant PythonTerrainWrapper
participant PansharpenOperation
PythonCaller->>PythonTerrainWrapper: pansharpen inputs and options
PythonTerrainWrapper->>PansharpenOperation: spectral bands and PansharpenOptions
PansharpenOperation-->>PythonTerrainWrapper: pansharpened RasterDataset
PythonTerrainWrapper-->>PythonCaller: Raster result or destination output
Merge Risk: 
Minimal · up to 95c0f
-
This adds weighted Brovey pansharpening across the Rust, CLI/MCP, Python and JavaScript interfaces. The PR reports GDAL parity checks and binding tests. The materialized implementation buffers full images in memory, which the author documents and defers to bounded virtual processing in later work. No concrete merge-blocking risk remains in the reviewed evidence.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 47.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 36 functions across 17 files. (7 skipped: 7 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- 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.
A rabbit lays out bands in rows,
Then blends their colors as light flows.
The pan band guides each spectral hue,
While weights and footprints shape the view.
Tests compare each pixel’s place,
And rabbit hops through sharper space.
Comment @coderabbitai help to get the list of available commands.
Code reviewI reviewed the pansharpen op, CLI, bindings, docs and tests by reading the diff and source. I did not build the code or run any tests. Bugs
Security
Performance
Quality
CLAUDE.md
|
Match GDAL fractional RasterIO origins across all resamplers, accept shared affine space without a CRS, and bound convolution to needed rows. Document intentional nodata loss during footprint adjustment and compare both inferred and explicit nodata on real shifted images.
Code reviewI read the full diff and the surrounding source. The review is from reading only: I could not run the build or the tests. The change adds weighted Brovey pansharpening with a core op, CLI, Python, JS and MCP bindings, docs, tests and a GDAL comparison script. I found no correctness bugs and no security issues. Bugs
Security
Performance
Quality
CLAUDE.md
|
# Conflicts: # docs/javascript.md
Code reviewI reviewed the core algorithm in Bugs
Security
Performance
Quality
CLAUDE.md / AGENTS.md
|
Code reviewI read the core algorithm in Bugs
Security
Performance
Quality
CLAUDE.md / AGENTS.md
|
Code reviewI read the core algorithm ( Bugs
Security
Performance
Quality
CLAUDE.md / AGENTS.md
|
Code reviewI read the core algorithm, Bugs
Security
Performance
Quality
CLAUDE.md
|
Summary
The materialized API buffers complete inputs and working/output planes. On Linux, a real 1024×1024 UInt16 pan with three 512×512 spectral bands used 125,544 KiB peak RSS with two runtime threads. Memory grows with image area and band count; the bounded virtual/block-I/O follow-up is required before item 8 is complete.
Validation
Refs #238 (item 8, materialized output).