Add German waterway bathymetry for the tidal estuaries - #155
Merged
Conversation
The German federal waterway DEM (2 m, NHN elevation) enters as a prepared mixed_crs source, scoped to the 16 tidal/estuary tiles (Nordsee, Aussenelbe, Jade, Unter-/Aussenweser). build_reference.py composes the SKN-in-NHN chart datum surface — the BSH SKN-Flaeche Nordsee grid west of ~9.5 E, the inner tidal Elbe filled from the GDWS per-gauge SKN table along the gauge line — and the prep subtracts it per pixel (offset_surface) and clamps above-datum cells, so the COG is depth below chart datum. The inland reaches (beds tens of metres above MSL) stay commented out in file_list.txt until their low-water surfaces (GlW/Stauziel/MNW) land. Validated end to end on outer Elbe km710-728 and inner Elbe km620-639; extracted from the add-source-wsv-dgmw branch (PR #76), ported from the Justfile lane to the Snakemake sources lane.
This was referenced Aug 15, 2026
The gauge line ended at Zollenspieker (km 598), so the corridor fill left km 586-598 of the active km585_600 tile un-referenced and those beds read at raw NHN — up to ~1.9 m too deep. A held-flat anchor at the weir's downstream face extends the spine over the whole tidal reach; holding Zollenspieker's SKN reads shallow versus the true taper, the safe direction. Found by review on PR #155.
There was a problem hiding this comment.
Pull request overview
Adds a new prepared bathymetry source (dgm_w) for German tidal/estuary waterways, including a bespoke SKN (chart datum) reference surface build so the ingested tiles render as depth (below datum) rather than raw NHN elevation.
Changes:
- Register WSV DGM‑W as a source (metadata + documentation) and enable only the 16 tidal/estuary tiles in
file_list.txt. - Add a new datum surface build script (
sources/dgm_w/build_reference.py) and wire it into Snakemake via a dedicateddatum_surface_dgm_wrule. - Update the global sources catalog (
sources/README.md) to list the new Germany DGM‑W source and its datum.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| sources/README.md | Adds DGM‑W to the top-level sources table with scope/datum summary. |
| sources/dgm_w/tideelbe_skn.csv | Introduces checked-in SKN gauge reference points for inner tidal Elbe fill. |
| sources/dgm_w/README.md | Documents dataset access, licensing, scope limitations, and datum normalization approach. |
| sources/dgm_w/metadata.json | Defines prepared-source knobs (mixed CRS, nodata, offset_surface, clamp_positive, max_zoom). |
| sources/dgm_w/file_list.txt | Activates only tidal/estuary tile URLs; comments out inland tiles pending inland datum surfaces. |
| sources/dgm_w/build_reference.py | Implements composition of dgm_w_lowwater surface from BSH grid + gauge corridor fill. |
| Snakefile | Excludes dgm_w_lowwater from the generic VDatum datum rule; adds dedicated datum_surface_dgm_w rule. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The whole zip and its GeoTIFF member were held in RAM before writing; streaming the download and copying the member out keeps memory bounded whatever size a future grid edition ships at. Review comment on PR #155.
* origin/main: GC: strict mosaic listing — it is the delete universe and absence oracle GC: absence is proof, errors are not; reconcile build.md Re-root the weekly GC on the published mosaic Address review: cache builder inputs, guard basenames, real precedence check Address review: tolerant link regex, clearer datum wording Add the French chart-datum surface and per-surface builder dispatch Add Kartverket 50 m bathymetry (Norway, Svalbard, Barents Sea) # Conflicts: # Snakefile
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.
Adds the German federal waterway bathymetry (WSV DGM-W) as a prepared source, scoped to the 16 tidal/estuary tiles: Nordsee, Außenelbe below the Geesthacht weir, Jade, and Unter-/Außenweser. This is the first half of the #76 split; the inland reaches follow in #156, stacked on this one. Part of #53.
What it is
DGM-W (Digitales Geländemodell des Wasserlaufs) is the WSV's 2 m terrain-plus-riverbed model for the federal waterways, published through the WSV INSPIRE "Höhe" Atom download service as 93 zipped GeoTIFF tiles (Float32, nodata −32768, per-region CRS →
mixed_crs, one.tifper zip →unpack: "zip:*.tif!1"). The feed's contour zips are excluded; Seascape builds its own contours. The 77 inland tiles stay commented out infile_list.txtuntil their low-water surfaces land.The datum problem
DGM-W stores orthometric NHN elevation, not depth. NHN ≈ MSL, so a bed value used as-is reads a metre or few deeper than a chart in these macrotidal estuaries, which is the dangerous, optimistic direction. The prep subtracts an SKN-in-NHN reference surface per pixel (
offset_surface) and clamps above-datum cells to nodata (clamp_positive), so the synced COG is depth below chart datum (SKN ≈ LAT). Same mechanism as the CUDEM/VDatum correction, so there are nopipelines/changes at all.The surface itself is bespoke:
sources/dgm_w/build_reference.pycomposesstore/datum/dgm_w_lowwater.tiffrom the BSH "SKN-Fläche Nordsee 2026" grid (CC-BY 4.0) over the outer estuaries, extended east of the grid's ~9.5° E edge over the inner tidal Elbe using the GDWS per-gauge SKN table (tideelbe_skn.csv) interpolated along the gauge line. A newdatum_surface_dgm_wSnakefile rule runs it, keyed on the script and its data files; the generic VDatum rule now matches only the VDatum surfaces.Validated end to end in #76 on outer Elbe km710–728 (BSH grid) and inner Elbe km620–639 (assembled fill), both yielding water-only depths below chart datum.
Known follow-up carried over from #76:
clamp_positivealso drops intertidal drying flats; reconciling the clamp against the OSM land–water mask is tracked in the README.Not for navigation. Licences: DEM GeoNutzV (attribute WSV), SKN-Fläche CC-BY 4.0 (attribute BSH).