DEM improvements to nodata, buffer and other corner cases#321
Merged
DEM improvements to nodata, buffer and other corner cases#321
Conversation
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 <louise@openrobotics.org>
This was referenced Mar 15, 2022
Signed-off-by: Louise Poubel <louise@openrobotics.org>
…-common into chapulina/dem Signed-off-by: Louise Poubel <louise@openrobotics.org>
mjcarroll
approved these changes
Mar 30, 2022
Contributor
mjcarroll
left a comment
There was a problem hiding this comment.
One place for const, LGTM.
Signed-off-by: Louise Poubel <louise@openrobotics.org> Co-authored-by: Michael Carroll <michael@openrobotics.org>
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.
🦟 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 == 0for the padding, which is very awkward for DEMs below ground. This PR changes thebufferValto 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
codecheckpassed (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-bymessages.🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸