Skip to content

Lunar elevation inconsistent between osgEarth and GDAL #2672

Answered by gwaldron
ravidavi asked this question in Support Q&A
Discussion options

You must be logged in to vote

Hi Ravi,

I suspect the discrepency you see is down to two things:

  1. Either osgEarth 2.x or GDAL 2.1.3 was not properly accounting for the GeoTIFF scale factor (a bug)
  2. You need to tell gdallocationinfo to use bilinear interpolation.

I tested this using GDAL 3.10.
QGIS and Global Mapper report the correct value at Lon Lat (-90,0) = ~179m.

Run gdallocationinfo with bilinear interpolation:

set PROJ_IGNORE_CELESTIAL_BODY=1
gdallocationinfo Lunar_LRO_LOLA_Global_LDEM_118m_Mar2014.tif -wgs84 -r bilinear -90 0
Report:
  Location: (23040.0000011021P,23040L)
  Band 1:
    Value: 358.499995591526
    Descaled Value: 179.249997795763

The descaled value is what you want. gdalinfo says:

Band 1 Block=2…

Replies: 3 comments 11 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
10 replies
@gwaldron
Comment options

@ravidavi
Comment options

@gwaldron
Comment options

@ravidavi
Comment options

@gwaldron
Comment options

Answer selected by ravidavi
Comment options

You must be logged in to vote
1 reply
@ravidavi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants