Receiving elevation data through Cesium

211 views
Skip to first unread message

to...@daloisio.com

unread,
Oct 6, 2015, 3:01:03 PM10/6/15
to cesium-dev
I've noticed that when trying to acquire elevation data through Cesium that the numbers are not accurate when zoomed out. I noticed this when trying to create a lat/lon/elevation readout. Some of the elevation values were in the negative thousands, but resolved as I zoomed in.

The method I'm using to acquire elevation is
viewer.scene.globe.getHeight( cartographic )

Thanks,
Tony

Hannah Pinkos

unread,
Oct 6, 2015, 4:09:29 PM10/6/15
to cesium-dev, to...@daloisio.com
Hello,

This is because value of getHeight will change depending on the current level of detail needed for the globe terrain based on the camera distance.
For consistent results, you can use the sampleTerrain function.  You specify the terrain provider, the level of detail at which to query, and an array of cartographic positions.  It will return a promise to an array of cartographic with a height.
You can see an example of how to use this function in the Terrain Demo.  Scroll to where it says "Sample Everest Terrain".

Best,

Hannah

to...@daloisio.com

unread,
Oct 7, 2015, 11:08:57 AM10/7/15
to cesium-dev, to...@daloisio.com
Thanks, that fixed it.

Another question. Is there a way to get Cesium to calculate elevation in terms of mean sea level rather than height above WGS84 ellipsoid?

Matthew Amato

unread,
Oct 7, 2015, 11:36:03 AM10/7/15
to cesiu...@googlegroups.com
Not yet, but it is on the roadmap.


--
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 cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

to...@daloisio.com

unread,
Oct 7, 2015, 2:18:13 PM10/7/15
to cesium-dev
So what height does Cesium's heightmap format represent? The spec for Heighmap just says elevation is in meters.

Alexander Wood

unread,
Oct 7, 2015, 2:52:32 PM10/7/15
to cesiu...@googlegroups.com
Cesium assumes this height is meters above the WGS84 ellipsoid.

On Wed, Oct 7, 2015 at 2:18 PM, <to...@daloisio.com> wrote:
So what height does Cesium's heightmap format represent?  The spec for Heighmap just says elevation is in meters.
Reply all
Reply to author
Forward
0 new messages