Skip to content

Commit

Permalink
Moved the call to HeightFieldUtils::resolveInvalidHeights()
Browse files Browse the repository at this point in the history
from ElevationLayer::populateHeightField() to ElevationPool::getOrCreateRaster().
This resolves an issue where if you used a CompositeElevationLayer
along with a GDALDEM layer you would get areas colored in that should be
transparent because CompositeElevationLayer was calling populateHeightField
under the hood which was resolving NODATA_VALUE to 0 before rasterizing.
  • Loading branch information
jasonbeverage committed Jan 9, 2025
1 parent 0f90160 commit 10c926f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/osgEarth/ElevationLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1242,9 +1242,6 @@ ElevationLayerVector::populateHeightField(
}
#endif

// Resolve any invalid heights in the output heightfield.
HeightFieldUtils::resolveInvalidHeights(hf, key.getExtent(), NO_DATA_VALUE, 0L);

if (progress && progress->isCanceled())
{
return false;
Expand Down
3 changes: 3 additions & 0 deletions src/osgEarth/ElevationPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,9 @@ ElevationPool::getOrCreateRaster(
map->getElevationInterpolation(),
progress);

// Resolve any invalid heights in the output heightfield.
HeightFieldUtils::resolveInvalidHeights(hf.get(), keyToUse.getExtent(), NO_DATA_VALUE, 0L);

if ((populated == true) ||
(acceptLowerRes == false) ||
(progress && progress->isCanceled()))
Expand Down

1 comment on commit 10c926f

@canacar7
Copy link

@canacar7 canacar7 commented on 10c926f Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your quick response and solution. I appreciate your support!

Please sign in to comment.