Repository navigation
fix(engine): a saved relief step requires its capability only when the command would draw it - #3291
Conversation
…e command would draw it `command_sets_aerial` and `command_sets_shadow_softness` now read a saved `raster.symbology` as the command does: only a Shaded Relief (its type matched as the command matches it, a stretch when left out) reads either key, and a numeric string is its number. The default softness, 5 or "5", which the command keeps as none, requires nothing, like `null`. Follow-up promised on opengeos#3260. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Code reviewScope: 2 files, I checked that the narrowed predicates agree with the command for each case: non-relief types ( Bugs
Security
Performance
Quality
AGENTS.md
Change sizeCompared: the whole PR against main (merge base 0286882 to PR head 04b6830).
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the |
Follow-up to #3260 (aerial perspective, #3141) and #3200 (shadow softness, #3144), as promised in #3260's review threads: the
typecheck and reading the value as the command does, where the reply noted that the softness predicate had the same gap.What it does
A saved step (task, model, history, script) whose
raster.symbologysets a relief key requires the project capabilityshaded-relief-aerialorshaded-relief-shadow-softness, so an older RustGIS refuses the file instead of running the step without the key. The two predicates now read the step as the command reads it. Before, they read it more broadly, so some files were refused that an older reader draws the same:raster.symbologyreadsaerialandshadowSoftnessonly when it draws a Shaded Relief.typeis matched as the command matches it: case and spaces,_and-don't count,hillshadeis the same renderer, and a left-out type is a stretch. A step with another type stored nothing, yet required the capability.shadowSoftnesswas any non-null value, so the default5(or"5"), which the command keeps as none, required the capability. It is now read withcmd::f, the command's parser, likeaerialsince feat(map): a Shaded Relief's aerial perspective hazes and flattens its low ground (#3141, part 1) #3260, and the default requires nothing, likenull.The type matching moves out of
symbologyintocmd::raster::symbology_kind, so the command and the predicates share it;symbology_is_reliefnames the relief arm.A layer that stores either setting still requires its capability, as before. Nothing about saving, drawing or the schema changes.
Tests
Written first; they failed on main's predicates:
an_inline_graph_node_is_checked_as_a_saved_step_is) gainsstretchand left-out types with both keys (nothing required),hillshadeand"Shaded Relief"(required), and softness5,"5"(nothing) and"1.5"(required). Each sample is also checked as a node in an inline model graph.script.runloop checks both keys, at a default and a set value, undershadedReliefandstretch.Local runs (Windows):
rustgis-engine2792 passed, with two failures that this change does not touch:layout_report_text::a_report_measures_each_layout_page_with_its_own_page_number(text measurement from #3215; it fails the same way in this machine's runs of other branches) andcloud_optimised_geotiffs_are_read_in_place(it counts the bytes a local server sends; it failed in a run on a loaded machine and passes on its own). The capability tests (55) pass.cargo fmtandcargo clippy -D warnings(engine, all targets) pass.Size: 51 changed lines (+41 −10).
🤖 Generated with Claude Code
Summary by CodeRabbit