Skip to content

137: per-triangle DEM height histogram (--dem-heights) - #431

Merged
skavhaug merged 23 commits into
masterfrom
worktree-dem-stats
Nov 5, 2026
Merged

skavhaug merged 23 commits into
masterfrom
worktree-dem-stats

Conversation

@skavhaug

@skavhaug skavhaug commented Nov 5, 2026

Copy link
Copy Markdown
Member

Increment 137 (docs/increments/137-dem-stats.md): each triangle's DEM height histogram behind --dem-heights, off by default.

  • Each DEM pixel is weighted by its exact overlap with the triangle, using the clip shared with land cover; land cover's bytes are unchanged.
  • The class width is the DEM's relative vertical accuracy. The class count per triangle spans the DEM nodes it holds, so it converges to one class as the mesh refines.
  • Output is a sparse table in .vtk, .ply and .gpkg.

577 counted lines. Red fa7cc0e, plus 237447f for plugin_api SIGNATURES, which that test asks to be updated on its own. Green a1d6c1d. Kill record: 37 mutants over 14 targets plus three extra, all killed or proven equivalent (docs/increments/137-probes/kill-record.md). @Perf section 8: with the flag off, time and bytes equal master; with it on, +0.065 s and +10 MB on the test tile.

Review verdicts:

  • Code round 1: CHANGES REQUESTED 5cd5388
  • Code round 2: CHANGES REQUESTED 8163ac6
  • Code round 3: APPROVED 821af44

🤖 Generated with Claude Code

skavhaug and others added 23 commits November 4, 2026 10:07
…area; DEM pixel statistics argued out, their walk held (@architect)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…out its plane, behind --dem-heights; plan area dropped (@architect)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hreshold, the reprojected path read on the source's own pixels (@architect)

Design review of 6f0e20d returned CHANGES REQUESTED: the 50-node threshold
left 72 % of Bygdin's triangles without a histogram. Measured: the overlap
walk costs 1.2 times the error summary's node walk at 10 threads on Bygdin,
no extra peak memory; the resampled grid narrows histograms by 4-8 % in
spread against the source's pixels, so the source is read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…8fe80c, float32 tolerances)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…erance wide, the residual at the pixel centre (@architect)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… residual named rho)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lished vertical accuracy, each triangle carrying only the classes its own nodes reach (@architect)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…GLO-30's 2 m LE90 as 1.216 m, for ANADEM too; DTM10's absolute 1 m kept as an upper bound) (@architect)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ise, Velhas agreement, size +507, row-sum bound, convergence range (@architect)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…angles)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eld nodes' span, classes as wide as the DEM's relative accuracy (@tester)

Binding (tests 4-8, 19, the margin, edges, refusals, GIL, stub), dem_heights
and HeightTable (tests 3, 22, chunks, reprojected), the reader (test 15), the
command (tests 1, 2, 10, 11, 13, 14, 16-18, 20, 21, --triangles), the off
digests at 98fe80c keyed by platform (test 12), the C++ property (test 9);
the new field joins the catalogue tests, the module the layering table, the
binding the threads list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…m=None, last, on purpose for 137 (@tester)

Increment 137 (3.4) adds the field to the source model; plugins see one more
keyword with a None default. The PR body says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…its plane, sparse by its held nodes' span, in .vtk, .ply and .gpkg (@developer)

C++: statistics/height_shares.hpp on overlap.hpp's clip, now a piece
visitor shared with class_areas (its bytes unchanged); the binding
dem_height_shares. Python: dem_heights (classes, chunks, the reprojected
path on the source's pixels), HeightTable, the writers and the reader,
relative_vertical_accuracy_m on sources (1.216 m for glo30 and anadem-v1),
and --dem-heights with its refusals and record entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 4 are classes +-2, not the end classes (@tester)

The redone kill record on a1d6c1d found the mutant that drops the
division in class_of's quotient (height_shares.hpp:65) alive: the
raise and lower steps repair every class except where the early clamp
fires, which needs a residual past n + 1 m but inside (n + 1/2) w, so
w > 1. No scene had one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s n = 8, though the quotient's floor says 7 (@tester)

The redone kill record on a1d6c1d found the mutant that raises n
while (n + 1/2) w < tolerance, not <= (dem_heights.py:46), alive: the
floor of tolerance / w + 1/2 is already right on every listed case, so
the raise step was never exercised. At w = 1.216 the quotient rounds
low on the edge, as in test 4's residual case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…corded

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bytes; on costs +0.07 s and +10 MB on the fixture tile, +0.03 s on a 4-piece cut, nothing on Velhas (@Perf)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… - 1/2) w, and the kill record is docs/increments/137-probes/kill-record.md (@tester)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-party section (ruff I001) (@tester)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@skavhaug
skavhaug added this pull request to the merge queue Nov 5, 2026
Merged via the queue into master with commit 709a5f3 Nov 5, 2026
15 checks passed
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.

1 participant