You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: Shaded Relief: set how soft the cast shadows' edges are #3144
Cast shadows (#1796) have a soft edge fixed at 5° either side of the sun's altitude (SOFT_EDGE, crates/map/src/shadow.rs:23), chosen for a soft edge at map scale. One width doesn't suit every map. A large-scale map of a cliff wants a crisp shadow line; a small-scale map of a mountain range wants the shadows to fade so they don't read as dark patches. Relief shading tools (Eduard's cast shadows have a blur setting) let the user choose. #1796 listed this as a possible setting.
Proposal
A new setting, Shadow softness (raster.symbology"shadowSoftness", degrees, 0.5 to 15, default 5): half the sun's apparent size used to trace cast shadows. The default draws today's pixels.
Choices in this proposal
The sun's apparent size, not a blur. The soft edge is already the share of the sun's disc hidden. Widening the disc keeps a shadow sharp where its caster is near and soft where it is far, as real penumbras are. A blur would soften both alike.
0.5° to 15°. I tried 1.5°, 5° and 10°. The bounds are a guess to check in review: a much smaller disc should step at the cell size, and a much larger one blur the shadows away.
Part of the shadow grid's key. The grid is traced again when the softness changes, as it is when the sun moves.
No setting for the sky's reach. I measured it: 25, 100 and 300 cells give the same picture (no pixel moved by more than 8 levels) on a 90 m DEM of the Caparaó at 1:200,000. Only the cost changed: one run each took 4.3 s at 25 and 9.6 s at 100. A cheaper default reach could be considered separately, but not a setting.
Measured (local prototype)
Copernicus DEM GLO-30 of Ouro Preto, the Itacolomi and its scarps, 1:120,000, sun 315° / 20°, Z factor 1.5, shadow 0.8. Against today's 5°:
Activity
fix(engine): a saved step setting a shadow softness requires it (open…
fix(map): a sun disc reaching the zenith keeps its share above steep …
fix(map): no sun disc edge is held under 90° (opengeos#3144)
fix(map): the default sun disc is traced exactly as before (opengeos#…
feat(map): a Shaded Relief's cast shadows take a softness for their e…