Skip to content

feat(ui): an "Aerial perspective" field in a Shaded Relief's style pane (#3141, part 2) - #3287

Merged
elpidioassinaturas merged 4 commits into
opengeos:mainfrom
elpidioassinaturas:feat/3141-aerial-pane
Nov 29, 2026
Merged

elpidioassinaturas merged 4 commits into
opengeos:mainfrom
elpidioassinaturas:feat/3141-aerial-pane

Conversation

@elpidioassinaturas

@elpidioassinaturas elpidioassinaturas commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Closes #3141 (part 2 of 2; part 1 was #3260).

What it does

The style pane's Shaded Relief settings gain Aerial perspective (0 to 1), after Ambient. Moving it runs raster.symbology with "aerial", the setting part 1 added, so Undo, saving and the project capability work as they do for the command. Its tooltip: "Low ground, by its height on the stretch, lit with less contrast and hazed, so the high ground stands out, from 0 (none) to 1".

The user guide (docs/user-guide/data.md) describes the setting next to Ambient and Balanced light.

Style pane with Aerial perspective at 0.60

The pane above: Copernicus DEM GLO-30 of Ouro Preto (Minas Gerais), Terrain ramp, stretch 650–1,912 m, aerial perspective 0.6, from the headless ui_shot example. DEM: Copernicus DEM GLO-30, © DLR e.V. and Airbus, provided under COPERNICUS by the European Union and ESA.

Surfaces

Tests

  • rustgis-render: a_reliefs_aerial_perspective_lightens_its_page draws a layout page whose frame and colour bar show a relief rising eastward, at 0, 0.6 and 1. Each page is lighter than the one before.
  • Local runs (Windows) after merging main: rustgis-render 960 passed; rustgis-ui-egui 1707 passed (lib) plus its integration tests. cargo fmt and cargo clippy -D warnings (render, ui-egui, all targets) pass.

Size: 51 changed lines (+49 −2).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added an Aerial perspective control for shaded relief, adjustable from 0 to 1. Higher values add haze and reduce contrast based on elevation within the layer’s stretch.
  • Documentation
    • Updated the raster guide with the setting’s range, default, and behavior.

elpidiofilho and others added 4 commits November 28, 2026 14:55
… its low ground (opengeos#3141)

Part 1 of opengeos#3141. A new Shaded Relief setting, "aerial" (0 to 1, default
0). With t a cell's height on the layer's stretch and
k = aerial × (1 − t)^1.5, the cell's light is pulled 0.7 k toward flat
ground's light, lowering the contrast of low ground, and its colour is
mixed 0.45 k toward a light haze (#ECECEC). Summits keep their relief,
so the high ground stands out.

It is painted in the Colorizer, so the map, exports, layouts and the 3D
drape all draw it; a colour bar shows the haze but not the pull, which
is the shading's contrast and not a colour of the ramp. raster.symbology
takes "aerial" (left out, kept; outside 0 to 1, refused; null or 0,
none); a layer or saved step setting it requires shaded-relief-aerial.
The style pane's field and the user guide come in part 2.

At 0 a relief is drawn pixel for pixel as before:
no_aerial_perspective_paints_as_before checks every pixel against main's
formula, copied into the test, over heights, hillshades, sky, fill,
rock, ambient, balanced light, sun altitude and brightness.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ne (opengeos#3141)

Part 2 of opengeos#3141. The style pane's Shaded Relief settings gain "Aerial
perspective" (0 to 1), which runs raster.symbology with "aerial". The
user guide describes the setting, and a layout page test checks that a
page whose frame and colour bar draw a relief rising eastward is lighter
the stronger the setting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	crates/engine/src/project_capabilities.rs
#	crates/ui-egui/src/panes.rs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Shaded Relief controls now expose an aerial perspective setting and send its value through raster.symbology. A regression test checks rendered colorbar pixels at three settings, and the Rasters guide documents the setting.

Changes: Shaded Relief Aerial Perspective

Layer / File(s) Summary
Expose and document aerial perspective
crates/ui-egui/src/panes.rs, crates/render/src/layout/tests.rs, docs/user-guide/data.md
The Shaded Relief pane reads and sends the aerial value through raster.symbology. A regression test checks that summed colorbar pixel values increase at 0.0, 0.6, and 1.0. The guide documents the setting, its range, behavior, and persistence.

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

Change: Feature

Possibly related issues

  • opengeos/RustGIS#3150 — Presets for Shaded Relief lighting settings could include the aerial perspective value added here.

Possibly related PRs

  • opengeos/RustGIS#3260 — This PR adds the rendering parameter and behavior that the UI control in this change exposes.

Suggested reviewers: giswqs, jgregoriorincon

Merge Risk: Minimal · up to 60586

This adds an Aerial perspective control to the style pane and documents it. It uses the existing command path, and a value of 0 leaves current maps unchanged. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(ui): an 'Aerial perspective' field in a Shaded Relief's style pane (#3141, part 2)" names the main change: a new Aerial perspective control in the Shaded Relief section of the style pa…
Description check Passed The description follows the template's main sections: Summary ("What it does"), Testing ("Tests"), and a UI evidence section with a before/after-style screenshot of the new pane control. It omits the …
Linked Issues check Passed Issue #3141 coding requirements: (1) an Aerial perspective setting for shaded relief, 0 to 1, default 0, exposed as raster.symbology "aerial"; (2) the haze and contrast effect driven by cell height on…
Out of Scope Changes check Passed All changed areas connect to #3141. The panes.rs change adds the Shaded Relief control that the issue requests. The docs/user-guide/data.md change documents that control, which the issue's scope cover…
Full details: Title check

Explanation

The title "feat(ui): an 'Aerial perspective' field in a Shaded Relief's style pane (#3141, part 2)" names the main change: a new Aerial perspective control in the Shaded Relief section of the style pane. The changeset adds that control in crates/ui-egui/src/panes.rs, documents it in docs/user-guide/data.md, and adds a render regression test. The title is somewhat long at 87 characters, and the issue and part references add detail, but it is specific and accurate.

Full details: Description check

Explanation

The description follows the template's main sections: Summary ("What it does"), Testing ("Tests"), and a UI evidence section with a before/after-style screenshot of the new pane control. It omits the Related issue section's formatted line, but it states 'Closes #3141 (part 2 of 2; part 1 was #3260).' at the top. The UI evidence section lacks a before image, though the change adds a new control, so after-only evidence is acceptable under the template. The template's 'No visible UI change' line is not applicable here, and the author correctly replaced the section with a screenshot. Testing details are clear, and the surfaces section explains which interfaces are affected.

Full details: Linked Issues check

Explanation

Issue #3141 coding requirements: (1) an Aerial perspective setting for shaded relief, 0 to 1, default 0, exposed as raster.symbology "aerial"; (2) the haze and contrast effect driven by cell height on the layer stretch; (3) a value of 0 leaves maps unchanged. This PR adds the style-pane control in crates/ui-egui/src/panes.rs. The control sits after Ambient, ranges 0 to 1 in 0.01 steps, and sends the value as the aerial parameter to raster.symbology. The pane reads the renderer's aerial value. The effect itself (light pull, #ECECEC haze, stretch-based height weighting, zero-value behaviour) is attributed to #3260 (part 1). The PR adds a layout-page regression test (a_reliefs_aerial_perspective_lightens_its_page) showing brightness rising at 0, 0.6 and 1. The author reports 960 render and 1707 ui-egui tests passing. Limitation: the render implementation file was not readable in this review (the diff read was unavailable and the panes.rs read was truncated), so the rendering behaviour rests on the PR description, the part 1 reference, and the layout test rather than on a direct read of the formula. The issue's non-coding items (user guide text) are documented in docs/user-guide/data.md.

Full details: Out of Scope Changes check

Explanation

All changed areas connect to #3141. The panes.rs change adds the Shaded Relief control that the issue requests. The docs/user-guide/data.md change documents that control, which the issue's scope covers as user-facing text. The crates/render/src/layout/tests.rs change adds a regression test for the rendering behaviour the issue specifies. The PR states that command line, Python, assistant, MCP and plugin interfaces are unchanged, and the change summaries show no edits to those interfaces or to public declarations. No unrelated change was identified. The same read limitation as the linked-issue check applies: the full panes.rs diff was not readable, so the absence of other edits in that file rests on the change summary.

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 finds the hills aglow,
With one new dial to set the flow.
Low ground fades; the highlands shine,
A guide and test keep things in line.
Then off I hop beneath the pine.

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: ebd3ca7f-c04d-4970-ae17-7a797cd688a1
Commits

Reviewing files that changed from the base of the PR and between 9f64d17 and 60586d1.

Files selected for processing: 3

  • crates/render/src/layout/tests.rs
  • crates/ui-egui/src/panes.rs
  • docs/user-guide/data.md

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

Comment thread docs/user-guide/data.md Resolved
Comment thread crates/render/src/layout/tests.rs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Code review

Bugs: None found. I checked the pane change against the engine and the renderer:

  • Leaving aerial out of the pane's raster.symbology calls keeps the current value. "aerial": null and out-of-range values are handled in crates/engine/src/cmd/raster.rs (lines 1072–1076, 1105–1110).
  • The formula in the user guide matches aerial_share and the blend in crates/map/src/raster.rs (lines 1466–1485, 2414–2424).
  • The colour bar uses the plain-light path, so it shows the haze but not the lowered contrast, as the guide says.
  • The capability check, the saved-project fixture and the command-surface snapshot were already in feat(map): a Shaded Relief's aerial perspective hazes and flattens its low ground (#3141, part 1) #3260 and need no change here.
  • panes.rs is shared with the browser, and the change adds no platform-specific code, so the wasm build is unaffected.

Security: None found.

Performance: None found. The change adds one slider and one tooltip.

Quality (both left for the release quality pass, as nits):

  • crates/render/src/layout/tests.rs:3143: the test checks only the ordering of three pages, using a sum over every byte of the page. Its doc comment says the default draws as before, but nothing here compares the default with the old page. That case is covered by no_aerial_perspective_paints_as_before in crates/map/src/raster.rs. Confidence: high. (Inline comment posted.)
  • docs/user-guide/data.md:1820-1822: the wrap breaks after "and" before the formula. Confidence: high. (Inline comment posted with a suggestion.)
  • crates/ui-egui/src/panes.rs:7536: let ae = *aerial; could be dropped and *aerial used directly in the slider list. Confidence: high. Not posted as an inline comment because it is trivial.

AGENTS.md: No rule breaks found. The part 1 command, capability and fixture changes already meet the rules on schema, the command surface and "never silent" refusals. This PR adds the pane field and the guide text only.

Prior reviews: The PR has no review threads, so I left no earlier concerns alone.

What I did not check: I did not build or run the tests (no shell in this environment). The author reports local test runs on Windows, and CI on Linux will be the real check.

Change size

Compared with main (merge base 9f64d17 to PR head 60586d1). The whole PR, not the latest push.

Measure Value
Files changed 3 (0 added, 3 modified, 0 removed, 0 renamed)
Size before 1.08 MB
Size after 1.09 MB
Total size change +2.5 KB
Path Before After Change
docs/user-guide/data.md 156.4 KB 157.5 KB +1.2 KB
crates/render/src/layout/tests.rs 440.6 KB 441.6 KB +1.0 KB
crates/ui-egui/src/panes.rs 513.3 KB 513.6 KB +341 B

@elpidioassinaturas
elpidioassinaturas added this pull request to the merge queue Nov 28, 2026
Merged via the queue into opengeos:main with commit 52ab156 Nov 29, 2026
28 checks passed
@elpidioassinaturas
elpidioassinaturas deleted the feat/3141-aerial-pane branch November 29, 2026 00:02
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.

[Feature]: Shaded Relief: aerial perspective, low ground lighter and softer so the high ground stands out

2 participants