# 3d-buildings-tiler clamptoground

**URL:** <https://community.cesium.com/t/3d-buildings-tiler-clamptoground/14248>\
**Category:** Cesium ion\
**Created:** [June 30, 2021, 9:16am UTC](https://community.cesium.com/t/3d-buildings-tiler-clamptoground/14248 "2021-06-30T09:16:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruediger\_Brand](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ruediger_brand/32/4004_2.png) [@Ruediger\_Brand](https://community.cesium.com/u/Ruediger_Brand)\
**Post date:** [June 30, 2021, 9:16am UTC](https://community.cesium.com/t/3d-buildings-tiler-clamptoground/14248/1 "2021-06-30T09:16:49Z")

</div>

Hi,

I have a CityGML with elevattion/altitude egm96.  
I would like to convert it to wgs84 - in ion I choose clampToGround and Cesium World Terrain.

As a result the buildings are over the terrain - using the adjust height sandcastle, I see that it is the original height.

What is the purpose of the clamptoground option - I expected, that my model is drapped on the Cesium World terrain or hs the heights of the world terrain and not the addition of both?

Has anyone a solution ?

Rüdiger

 ![CesiumJS_citygml_wgs84](https://global.discourse-cdn.com/cesium/original/2X/3/379157eee09ebff045e9312ff2d08faaefae6a81.png)

---

<div class="post-metadata">

**Author:** ![Matt\_Boyd-Surka](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/matt_boyd-surka/32/5511_2.png) [@Matt\_Boyd-Surka](https://community.cesium.com/u/Matt_Boyd-Surka)\
**Post date:** [July 9, 2021, 4:52pm UTC](https://community.cesium.com/t/3d-buildings-tiler-clamptoground/14248/3 "2021-07-09T16:52:14Z")

</div>

Hello, @Ruediger_Brand. Thanks for your question and for your patience in waiting on a reply.

The **Clamp to terrain** option is there for the purpose you’re expecting: it attempts to place buildings on the terrain as accurately as possible.

Unfortunately, because the EGM96 projection is a global projection like WGS84, it can result in some level of inaccuracy when converting to WGS84.

Our recommendation is that the CityGML source data be in a regional coordinate system, so that errors are kept to a minimum when it is converted to WGS84.

If you are able to share your data with us, we can take a look internally.

---

<div class="post-metadata">

**Author:** ![Ruediger\_Brand](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ruediger_brand/32/4004_2.png) [@Ruediger\_Brand](https://community.cesium.com/u/Ruediger_Brand)\
**Post date:** [July 15, 2021, 7:31am UTC](https://community.cesium.com/t/3d-buildings-tiler-clamptoground/14248/4 "2021-07-15T07:31:03Z")

</div>

Hi Matt,

I think there isn’t any problem with the projection - the projection is in both cases the same WGS84, only the elevation/altitude is in a different system.

My observation is, that the clamptoground parameter adds the height/elevation of the terrain to the heights in the cityGML and that is in my opinion no " clamptoground"

Rüdiger
