Add native modification-aware RAS Mapper terrain export - #321
Conversation
|
Final Linux/Wine qualification update (
Remaining qualification gaps: Wine runs for HEC-RAS 6.4.1, 6.5, and 7.0.1; the exact triangular-nose/minimum-Y fixture; and HEC-RAS Classic 7.1 once published. The PR remains open and unmerged. |
Fable QAQC follow-upClaude Code 2.1.251 / Fable independently reviewed the native terrain-export implementation. The accepted follow-up commits (
Final CLEAN verification after those fixes:
Qualification boundaries remain explicit: Windows-drive and UNC project/input paths are covered, but direct output to a UNC share and helper response paths beyond the legacy .NET 260-character limit remain unqualified. Per operator direction, the triangular/minimum-Y defect fixture was skipped; HEC-RAS 7.0.0 remains rejected. HEC-RAS 7.1 remains forward-open behind the managed-contract check but unqualified until an official Classic release is available. |
Summary
Adds
RasTerrain.export_rasmapper_terrain(), a supervised wrapper around RAS Mapper's registered-terrain Export to Single Raster operation.The API selects a terrain from the project
.rasmap, preserves RAS Mapper source ordering, priorities, stitches, masks, and vector modifications, and writes one bounded Float32 GeoTIFF. It supports exact source-derived 1x, 2x, 4x, and 8x nearest-neighbor output grids while allowing RAS Mapper to consolidate mixed-resolution registered sources.The operation runs out of process on native Windows and through configured Wine on Linux. It uses task-local state, supervises only owned processes, validates the completed raster before promotion, and returns a bool-compatible
TerrainExportResultwith a machine-readable JSON receipt. The derivative is not registered into the source project.RasTerrainMod.compute_modified_terrain_raster()is deprecated as of 0.99.2, emitsDeprecationWarning, and is scheduled for removal in 1.1. It remains available only for the compatibility window; native failures never fall back to the numerically different row sampler.Type of Change
Public API and Runtime Behavior
RasMap.list_terrain_layers().strandPathinputs,ras_objectmulti-project support, and explicit version consistency checks.resampleTo1RFI=Trueand optional nativeresampleVecModsrasterization..aux.xml,.ovr,.tfw, and.prjsidecars.wineservertermination.GenerateNewRasTerraincontract, including the final by-referenceTiffMetadata<float>parameter.ILONLY | 32BITREQUIRED.HEC-RAS Version Contract
GenerateNewRasTerrain(..., resampleVecMods, ...)contractVersion checks run before output directories or native work. Explicit terms,
RasPrj.ras_version, project executable paths, and resolved native/Wine installation directories reject prerelease labels before final-release canonicalization, including space-, hyphen-, and underscore-delimited beta forms.Native and Wine Qualification
Native Windows qualification covers every supported release with bounded modification-aware UPGU3 exports and stitched Muncie exports. The HEC-RAS 6.6 mixed-resolution Bald Eagle case produced one 61 x 61 GeoTIFF at exactly 40-foot cells from 36.504512049933-foot and 20-foot registered sources. Enabling native modifications raised 264 cells by 0.15625 to 9.625 feet while 1,769 control cells remained exactly unchanged.
Wine qualification covers every supported release:
gdalinfo, stage-directory, or partial-output survivor.Example Notebooks and Visual Evidence
b94f98c—316_terrain_modifications.ipynb: bounded originalTerrain50modification-off/on export, semantic table, and three-panel figure. Hydraulic cells were not rerun.c80c8c2—612_benefit_area_analysis.ipynb: native-export guidance with coherent existing outputs and four final maps retained; hydraulic simulations were not rerun.d90f478—920_terrain_creation.ipynb: all 26 safe cells freshly executed with bounded export/source evidence.0bef6af—930_terrain_modification_analysis.ipynb: all 10 analytical cells and two figures freshly executed without hydraulic simulation.9b183370—931_native_rasmapper_terrain_export.ipynb: new focused Muncie workflow; all nine cells freshly executed with stitched-grid, extent, inventory, receipt, and mutation evidence.Generated GeoTIFFs, receipts, and large qualification artifacts remain task-local and are not committed.
Independent Claude Code / Fable QAQC
Claude Code 2.1.251 reviewed the full PR using canonical
claude-fable-5at xhigh effort in strict read-only mode. Findings were independently reproduced before changes were made.Confirmed findings fixed in this branch include:
.tfw/.prjsidecar cleanup;Fable then reviewed the remediation and the two follow-up prerelease-guard deltas. The final targeted verification result was CLEAN, with no residual runtime beta-label finding.
Final Validation
py_compile, and Ruff: passed.validate: passed.Previously recorded broader evidence remains in the committed qualification report, including the opt-in native Windows matrix and the full repository run of 2,393 passed, 62 skipped, with eight documented baseline/environment-order failures outside this feature.
Qualification Boundaries
Review Checklist
pathlib.Pathused while acceptingstrandPathras_objectmulti-project conventions preservedLLM Attribution
Tools used: Codex and Claude Code/Fable