Rookie question regarding KML and altitudes

Skip to first unread message

Guy Morton

Mar 7, 2015, 6:10:07 PM3/7/15
Hi folks, and wow Cesium looks incredible. 

I am just starting out and am looking at the Sandcastle project, specifically the KML showcase and the bike ride. 

I note that the KML defines the altitude for each point on the trail so I assumed that would be used when showing the track in the viewer, however I experimented with changing the altitudes in the KML file and the track stays on the ground. 

Am I doing something wrong? I fully expect to be misunderstanding something, if anyone can be bothered giving me a nudge in the right direction I'd appreciate it.



Matthew Amato

Mar 7, 2015, 6:25:35 PM3/7/15
KML has a notion of `altitudeMode` which defaults to clampToGround, which means all heights are ignored and the track should always be on the ground.  If you add an altitudeMode of absolute to the bike ride, it will do what you want. The actually available altitudeMode options can vary slightly from track to track, in this case the bike ride is a gx:Track.  See this link for details:

Cesium parses are reads all altitudeMode settings, but we don't match Google Earth in terms of results yet.  For example, clampToGround clamps to the the ellipsoid and not the terrain while "absolute" provides height above ellipsoid instead of height above MSL.  We plan on addressing all altitudeMode issues in a near term release.

You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit

Guy Morton

Mar 7, 2015, 7:24:10 PM3/7/15
Thanks Matthew. I looked at the altitudeMode and it is set to absolute, which is why I was confused. 


and here is an example coordinate showing the altitude value:

<gx:coord>-75.300238 40.109584 1002</gx:coord>

The good news is that by opening it in Google Earth and fiddling with it I managed to make it work.

Google Earth added a second altitudeMode node under the gx:Track node. I suspect that is what fixed it. 


Note that even in GoogleEarth this doesn't seem to behave as expected - "absolute" seems to ignore the altitudes in the gx:coord nodes unless the text box next to the absolute setting says "various altitudes (min=-37m, max=1041m)". Not sure what that's about.

Perhaps it's worth updating the example, if the above is indeed a fix for the altitude being ignored?


Mar 17, 2016, 11:30:51 AM3/17/16
to cesium-dev
I was having the exact same issue as you, Guy. Even in the sandcastle example, the elevation is locked to the ellipsoid rather than terrain (even though altitude is included).

Thank you so much for adding to put <altitudeMode> in a second time. I was about to translate my .kml file to .czml and was not looking forward to the amount of time it would take me. Adding that in got my elevation working perfectly.

Reply all
Reply to author
Message has been deleted
0 new messages