-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DEM improvements to nodata, buffer and other corner cases #321
Conversation
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #321 +/- ##
=======================================
Coverage 77.12% 77.13%
=======================================
Files 76 76
Lines 10528 10540 +12
=======================================
+ Hits 8120 8130 +10
- Misses 2408 2410 +2
Continue to review full report at Codecov.
|
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
…-common into chapulina/dem Signed-off-by: Louise Poubel <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One place for const
, LGTM.
Signed-off-by: Louise Poubel <[email protected]> Co-authored-by: Michael Carroll <[email protected]>
🦟 Bug fix
Summary
Various small fixes to work with some DEMs I have:
Buffer to min height
Set buffer height to minimum height value. Non-square DEMs are automatically padded to become a square. The original logic is using
height == 0
for the padding, which is very awkward for DEMs below ground. This PR changes thebufferVal
to match the minimum height on the heightmap because a cliff down should be better than a cliff up, which is visible from far away.Example:
nodata comparisons
if (d > noDataValue)
check to prevent calculating the min / max values. I fixed that by guarding explicitly for NaNs.if (d > noDataValue)
I'm doingmath::equal(d, noDataValue)
.Dem::LoadData indentation
The entire function was too indented, so I fixed that as part of this PR. I recommend hiding whitespace changes to see what's actually changed.
GetProjectionRef and GetGeoTransform
These calls were returning values for my DEMs which weren't being well-handled. I added a guard and reduced an error to a debug message because the DEMs still work without these.
NetCDF
I also went ahead and used a NetCDF file (
.nc
) in a test to make sure we keep supporting this format.Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸