I had to dig deep into the UE code but I think I’ve found the answer.
The height map pixels use 32bit (4 channel) RGBA format. The first two channels represent the 16 bit height map. Therefore you need to bit shift the R channel by 8 bits and then use logical or operator to get the actual height. Se the code sample I’ve posted above and plug the below piece of code.
...........
uint16 height_value = (height.R << 8) | height.G;
...........
The B and A channels encode the tangents of the height map.
The first mip map (0) gives the full resolution height map. Other mip maps are divided by 2 in order. Also terrain mipmaps are generated differently than other texture mipmaps and they consider the 16 bit height values in the first two channels. Therefore it is safe to use the higher index mip maps (with lower resolution) if you desire.
Unreal height maps range from -256 to 256 meters within the scene. Therefore the height map having uint16:max would correspond to 256 meters. Of course you also need to take the Landscape actors scale into account. The z axis scale can effect this value in the game.
Another issue is that I think that the ULandscapeComponent’s HeightMapTexture members all correspond to the same height map that is the landscape height map. When I see this member within the ULandscapeComponent I thought that all components of the landscape do keep their own vertex height data within a separate texture. But this was wrong. So you need to sample the one and the unique Landscape actor heightmap for each vertex within a component if you want to export this height data somewhere.