Skip to content

Commit

Permalink
ElevationLayer: only apply the reverse vdatum transform for non-nodata
Browse files Browse the repository at this point in the history
  • Loading branch information
gwaldron committed Dec 20, 2024
1 parent 1d2e910 commit 536e052
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/osgEarth/ElevationLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,14 @@ ElevationLayer::assembleHeightField(const TileKey& key, ProgressCallback* progre
auto& source = sources[k].second;
if (source.getExtent().contains(points[i].x(), points[i].y())) // prevents clamping of out-of-bounds points
{
h = sources[k].second.getElevation(points[i].x(), points[i].y(), INTERP_BILINEAR)
- points[i].z(); // apply vdatum offset
h = sources[k].second.getElevation(points[i].x(), points[i].y(), INTERP_BILINEAR);
}
}
if (h != NO_DATA_VALUE)
{
// apply reverse vdatum offset if necessary
h -= points[i].z();
}
}
}

Expand Down

0 comments on commit 536e052

Please sign in to comment.