Get Heights in meters from PickPosition approach

87 views
Skip to first unread message

jose.che...@gmail.com

unread,
Jul 4, 2019, 7:38:30 AM7/4/19
to cesium-dev
When using scene.pickPosition, I got this:

(3922757.951194788, -75887.60464556298, 4861188.030801863)

and when converting them into degrees and height (meters) using

ellipsoid.cartesianToCartographic(cartesian),

I got this:

(-1.108276, 51.284312, -6770473.032675)

So, the height is wrong -6770473.032675?

How can I fix it?


Message has been deleted

jose.che...@gmail.com

unread,
Jul 7, 2019, 3:54:56 PM7/7/19
to cesium-dev

I got it,

cartographic = Cesium.Cartographic.fromCartesian(cartesian);
longitude= Cesium.Math.toDegrees(cartographic.longitude);
latitude= Cesium.Math.toDegrees(cartographic.latitude);
height= cartographic.height;

But you have to use a valid terrain (i.e. Cesium World Terrain), or your heights will be based on large negative values.

Omar Shehata

unread,
Jul 8, 2019, 10:39:10 AM7/8/19
to cesium-dev
Thanks for posting your solution Jose!
Reply all
Reply to author
Forward
0 new messages