Add Copernicus DEM (GLO-90/GLO-30) terrain backend - #75
Open
nebukadnezar wants to merge 1 commit into
Open
Conversation
Add two SrtmConf servers, copernicus_glo90 and copernicus_glo30, that read
the Copernicus DEM Cloud-Optimised GeoTIFFs from the AWS Open Data buckets.
These give a reliably working auto-download path (the SRTM servers are
effectively retired), global pole-to-pole coverage, and void-free terrain
over water.
The GeoTIFF reader reconciles the two ways Copernicus tiles differ from SRTM
.hgt: pixel-centre (area) registration vs grid-node, and the latitude-
dependent longitude spacing above |50 deg| (tiles are not square there). The
public API (srtm_height_data, srtm_height_profile, PathProp) is unchanged.
rasterio is used behind an import guard, matching the pattern in gis.py.
Add two SrtmConf failure-mode options: on_missing ('zeros'|'raise') and
void_fill ('zero'|'nan'|'interp'), both defaulting to the historic behaviour.
Fix the SRTM void mask: the canonical void sentinel -32768 was not masked
(only -32767/+32767 were), so genuine voids leaked through and were linearly
blended with valid neighbours into deep spurious pits.
Include tests, docs with the required Copernicus attribution, and a changelog
entry.
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.
Summary
Adds the Copernicus DEM (GLO-90 and GLO-30) as a terrain source alongside
SRTM, via two new SrtmConf servers. Also adds configurable missing-tile and
void handling, and fixes an SRTM void-mask off-by-one.
Motivation
point at the decommissioned USGS host; viewpano is unofficial). Copernicus
on the AWS Open Data buckets is a reliably working, no-auth download path.
into height profiles.
What is added
download='missing' machinery. Availability is validated against the bucket
tileList.txt, lazily fetched and cached in srtm_dir.
two differences from SRTM: pixel-centre (area) registration vs grid-node,
and the latitude-dependent longitude spacing above |50 deg| (tiles are not
square there; the reader uses the actual geotransform). The public API
(srtm_height_data, srtm_height_profile, PathProp) is unchanged pole to pole.
selected without it), matching the existing pattern in gis.py.
Failure-mode hardening
behaviour) or 'raise' (raise TileNotAvailableOnDiskError).
Bugfix: SRTM void mask
The reader masked only -32767/+32767, not the canonical SRTM void sentinel
-32768, so real voids leaked through and were linearly blended with valid
neighbours into deep spurious pits. All three are now masked.
Notes
buildings), same category as SRTM; this is documented in the code.
is not converted, since profiles depend on relative heights.
Tests
New tests in pathprof/tests/test_srtm.py: tile-name construction, pixel-centre
registration (synthetic plus a real Mont Blanc check), a value check against a
real downloaded GLO-90 tile (analogous to test_get_tile_data), non-square
high-latitude tiles, void masking and the three void_fill modes, on_missing
behaviour, tileList availability, download, and a GLO-90-vs-SRTM overlap
cross-check. Offline tests use small synthetic COGs and are skipped if
rasterio is absent; a few remote_data tests hit the real bucket.
Docs
docs/pathprof/working_with_srtm.rst gets a Copernicus section with the required
attribution. Module and SrtmConf docstrings and CHANGES.rst are updated.
Open points