# Elevation errors

**URL:** <https://community.cesium.com/t/elevation-errors/4555>\
**Category:** CesiumJS\
**Created:** [August 30, 2016, 1:27pm UTC](https://community.cesium.com/t/elevation-errors/4555 "2016-08-30T13:27:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![charles](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@charles](https://community.cesium.com/u/charles)\
**Post date:** [August 30, 2016, 1:27pm UTC](https://community.cesium.com/t/elevation-errors/4555/1 "2016-08-30T13:27:08Z")

</div>

Please help me get the elevation correct for my polyline.

In recognition that there is a discrepancy in height data between my source data and Cesium's terrain, I am retrieving new height data from a sampleTerrain command....

viewer.terrainProvider = new Cesium.CesiumTerrainProvider({url : '[//assets.agi.com/stk-terrain/world](https://assets.agi.com/stk-terrain/world)'});

......

var promise = Cesium.sampleTerrain(viewer.terrainProvider, 11, newEle);

(newEle is an array of data points [height, latitude, longitude)

However when a polyline populated with the new elevation for the same lat & lon is lain onto the terrain there is still a difference, sometimes greater than terrain, sometimes less than terrain height.

This is my development project showing the differences...

[https://www.putmebackon.com/cesium.htm?E=37&S=285](https://www.putmebackon.com/cesium.htm?E=37&S=285)

In particular between 0900 and 0910 hrs UTC you can see the variances clearly.

With thanks

Charlie

---

<div class="post-metadata">

**Author:** ![hannah](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/hannah/32/4509_2.png) [@hannah](https://community.cesium.com/u/hannah)\
**Post date:** [August 30, 2016, 2:36pm UTC](https://community.cesium.com/t/elevation-errors/4555/2 "2016-08-30T14:36:53Z")

</div>

It looks like you’re on the right track. Try sampling a higher level of the terrain.

-Hannah
