16c: a land-cover class per triangle, natural colours - #109
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The red suite of docs/increments/16c-landcover-labels.md, tests only: - test_landcover.py: regions and label_triangles on hand-made grid meshes (no _core call): the design's fixtures as pure meshes, D2's overlap rule, determinism under permutation, thin slivers; I1 and the centroid oracle (I2) on every fixture. - test_cli_mesh_landcover.py: the same fixtures through rasputin mesh on the bumpy DEM with I1-I3, the land_cover_codes field, the stderr line and stats phase, refused codes, no labels without a coded map, the PLY face property, a VTK readback, palette --out, and R5's feature_input fields. - test_palettes.py: every CLC class, the 34 Norway codes and 0 coloured; families by hue ranges; the ParaView preset; the palette command. - test_io_vtk_legacy.py / test_io_ply.py: triangle_codes and face_codes. - test_cli_mesh_features.py::TestCommittedExtract: I1-I3 and I5 on the quarter circle against shapely clips of the extract. - landcover_fixtures.py: the oracle, the spread check, vtk_labels. Every new test fails on a missing module, parameter, array or behaviour; the rest of the suite, ruff and mypy are green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Makes the red suite of 196147e pass; no test file touched. - landcover.py: regions (edge keys, np.isin, array union-find to a fixed point) and label_triangles (largest-inradius incentre per component, STRtree lookup, smallest area then smaller code), CoverLabels counts. - palettes.py: CORINE_NATURAL (44 CLC classes and 0) and paraview_preset. - feature_input.py: ClassMap.codes; TerrainFeature.code and .polygon for a coded map; codes refused outside 1 .. 2**31 - 1; a coded polygon with no boundary in the domain kept with no lines when it covers it. - io/vtk_legacy.py: triangle_codes -> cell array land_cover_code (0 on lines) in the features FIELD block; land_cover_codes joins RESERVED and its text arrives as the new parameter land_cover_codes. - io/ply.py: face_codes -> face property int land_cover_code; the comment comes from the CLI through comments. - cli.py: the land cover phase and stderr line, the codes to both writers, the palette command, one help sentence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… structure Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Increment 16c: a land-cover class per triangle, and natural colours for viewing. Design:
docs/increments/16c-landcover-labels.md; acceptance:docs/benchmarks/2026-09-29/bygdin-landcover.md.What it does
--features-map corine), each triangle gets the class of the input polygon it lies in. Triangles are grouped across edges that are not constraints (union-find), and each group is tested once against the polygons (shapely). The class is 0 on constraint lines and outside every polygon. Where polygons overlap, the smallest wins; the result is deterministic..vtk: an int cell arrayland_cover_codeon every cell, plus aland_cover_codesfield naming the code system..ply: anint land_cover_codeface property.rasputin palette corine --out corine_natural.jsonwrites a ParaView preset with natural colours for all 44 CORINE classes (forests green, heath light green, rock grey, bogs brown, water blue, glaciers near white).Numbers (AC, M1 Max)
Bygdin's catchment at 10 m with the Norway CORINE extract: 83 171 triangles, all labelled; class shares equal CORINE's clipped areas within 10⁻⁶ percentage points; the centroid oracle agrees on every triangle at 10 m and 1 m. Labelling takes 0.07 s at 10 m and 1.3 s at 1 m (more than refine at 1 m, which the design names as the trigger for moving it to C++ later).
Size
Net +249 production lines (CLAUDE.md §2).
Defaults chosen overnight are listed in the design for Ola to confirm.
🤖 Generated with Claude Code