I am trying to understand either what is wrong with my approach here or my understanding using 4978 ECEF coordinates from postgis in cesium.
The following query
SELECT
ST_X(ST_Transform(ST_SetSRID(ST_MakePoint(longitude, latitude, elevation), 4326), 4978)) AS x,
ST_Y(ST_Transform(ST_SetSRID(ST_MakePoint(longitude, latitude, elevation), 4326), 4978)) AS y,
ST_Z(ST_Transform(ST_SetSRID(ST_MakePoint(longitude, latitude, elevation), 4326), 4978)) AS z
FROM
(SELECT -121.93615138888889 AS longitude, 37.365277777777777 AS latitude, 0 AS elevation) subquery;
returns:
"x" "y" "z"
-2684803.3918930604 -4307256.836192265 3849690.991410601
The point doesn’t sit flush with the terrain as seen here: