# Terrain height calculation problems

**URL:** <https://community.cesium.com/t/terrain-height-calculation-problems/4582>\
**Category:** CesiumJS\
**Created:** [September 8, 2016, 2:24pm UTC](https://community.cesium.com/t/terrain-height-calculation-problems/4582 "2016-09-08T14:24:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aristeidis\_Bampakos](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/aristeidis_bampakos/32/2013_2.png) [@Aristeidis\_Bampakos](https://community.cesium.com/u/Aristeidis_Bampakos)\
**Post date:** [September 8, 2016, 2:24pm UTC](https://community.cesium.com/t/terrain-height-calculation-problems/4582/1 "2016-09-08T14:24:35Z")

</div>

Hi,

I am using the following piece of code to get the terrain height in a specified position:

var ray = viewer.camera.getPickRay(position);  
var height = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position).height;

To mitigate the differences between Cesium and Google Earth, I also query the Bing Elevations API to get the offset geoid sea level and finally subtracting it to find the actuallheight:

var realHeight = height - offset.

I have noticed that the real height matches that of Google Earth for some points and for others not. Is that reasonable?
