# Problems with CesiumTerrainProvider and heightmap-1.0 tiles

**URL:** <https://community.cesium.com/t/problems-with-cesiumterrainprovider-and-heightmap-1-0-tiles/7642>\
**Category:** CesiumJS\
**Created:** [October 31, 2018, 11:28pm UTC](https://community.cesium.com/t/problems-with-cesiumterrainprovider-and-heightmap-1-0-tiles/7642 "2018-10-31T23:28:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alan\_Rose](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/alan_rose/32/2293_2.png) [@Alan\_Rose](https://community.cesium.com/u/Alan_Rose)\
**Post date:** [October 31, 2018, 11:28pm UTC](https://community.cesium.com/t/problems-with-cesiumterrainprovider-and-heightmap-1-0-tiles/7642/1 "2018-10-31T23:28:40Z")

</div>

**Hi I am new to Cesium and trying to display some height tiles using CesiumTerrainProvider.**

\*\*I am currently getting error. “Failed to obtain terrain tile X: 1 Y: 0 Level: 0.” (Pretty sure I have followed the rules etc) \*\*

**Further debugging shows the reason as**

**message: "Invalid typed array length: 4225"**

**stack: "RangeError: Invalid typed array length: 4225↵ at new Uint16Array ()↵ at createHeightmapTerrainData ([http://localhost:8080/Build/CesiumUnminified/Cesium.js:38221:28](http://localhost:8080/Build/CesiumUnminified/Cesium.js:38221:28))**

**Which I’ll take to mean my tiles are invalid format. Does anyone have some good example heightmap-1.0 demo tiles that I can server up for testing purposes. Or even a url I can point at.**

\*\*I’ve looked at sandcastle demos but I don’t see any good examples using \*\ ***CesiumTerrainProvider. Thanks in advance.**

**Alan**

---

<div class="post-metadata">

**Author:** ![Alan\_Rose](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/alan_rose/32/2293_2.png) [@Alan\_Rose](https://community.cesium.com/u/Alan_Rose)\
**Post date:** [November 1, 2018, 3:26am UTC](https://community.cesium.com/t/problems-with-cesiumterrainprovider-and-heightmap-1-0-tiles/7642/2 "2018-11-01T03:26:12Z")

</div>

> My problem was due to a compression issue now fixed. However I have created some dummy tiles hoping to see some heights on the map but it always looks flat

I have only created tiles to a zoom level of 2. Does this matter I have zoomed in only two levels? or will it only be obvious at very high levels of zoom. Is there a way to check what height is used etc in the rendered view (ie get height from map function).

Also if I only want height detail at a very high levels of zoom does this mean I still have to have tiles above this level with their child flags set true?

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)\
**Post date:** [November 1, 2018, 6:53pm UTC](https://community.cesium.com/t/problems-with-cesiumterrainprovider-and-heightmap-1-0-tiles/7642/3 "2018-11-01T18:53:26Z")

</div>

Hey Alan,

How are you creating your terrain tiles? For getting height, check out these two functions:

[https://cesiumjs.org/Cesium/Build/Documentation/sampleTerrain.html?classFilter=Sample](https://cesiumjs.org/Cesium/Build/Documentation/sampleTerrain.html?classFilter=Sample)

[https://cesiumjs.org/Cesium/Build/Documentation/sampleTerrainMostDetailed.html?classFilter=Sample](https://cesiumjs.org/Cesium/Build/Documentation/sampleTerrainMostDetailed.html?classFilter=Sample)

---

<div class="post-metadata">

**Author:** ![Alan\_Rose](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/alan_rose/32/2293_2.png) [@Alan\_Rose](https://community.cesium.com/u/Alan_Rose)\
**Post date:** [November 1, 2018, 8:16pm UTC](https://community.cesium.com/t/problems-with-cesiumterrainprovider-and-heightmap-1-0-tiles/7642/4 "2018-11-01T20:16:06Z")

</div>

Thank you Omar I will check out these functions. I am only just starting out so there is still a lot to read and learn about Cesium.  
I have written my own TMS server (.net core) and currently just making up random .terrain files for testing purposes. I have image tiles already working OK, so now just need to master height tiles and then finally a quantizedmesh terrain.

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)\
**Post date:** [November 2, 2018, 2:44pm UTC](https://community.cesium.com/t/problems-with-cesiumterrainprovider-and-heightmap-1-0-tiles/7642/5 "2018-11-02T14:44:57Z")

</div>

Best of luck Alan!

If you haven’t already seen it, the Quantized Mesh spec is probably a good resource when you get there: [https://github.com/AnalyticalGraphicsInc/quantized-mesh](https://github.com/AnalyticalGraphicsInc/quantized-mesh)

---

<div class="post-metadata">

**Author:** ![Meir\_Ivry](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/meir_ivry/32/8407_2.png) [@Meir\_Ivry](https://community.cesium.com/u/Meir_Ivry)\
**Post date:** [March 9, 2022, 9:52am UTC](https://community.cesium.com/t/problems-with-cesiumterrainprovider-and-heightmap-1-0-tiles/7642/6 "2022-03-09T09:52:24Z")

</div>

Dear Alan,  
You wrote that your problem was due to compression issue.  
Can you please elaborate?

---

<div class="post-metadata">

**Author:** ![Alan\_Rose](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/alan_rose/32/2293_2.png) [@Alan\_Rose](https://community.cesium.com/u/Alan_Rose)\
**Post date:** [March 9, 2022, 8:25pm UTC](https://community.cesium.com/t/problems-with-cesiumterrainprovider-and-heightmap-1-0-tiles/7642/7 "2022-03-09T20:25:52Z")

</div>

You must have the wrong person. I have not used Cesium in over a year

---

<div class="post-metadata">

**Author:** ![Meir\_Ivry](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/meir_ivry/32/8407_2.png) [@Meir\_Ivry](https://community.cesium.com/u/Meir_Ivry)\
**Post date:** [March 10, 2022, 2:29am UTC](https://community.cesium.com/t/problems-with-cesiumterrainprovider-and-heightmap-1-0-tiles/7642/8 "2022-03-10T02:29:55Z")

</div>

Thanks anyways.
