heightReference for position in CZML

Hi all,
I have converted a GPX track to CZML. I have the path rendering properly but am unable to get the path to clamp to ground--it's roughly 30m below the surface but varying over time--probably because the GPS was changing its height fix over time. I attempted to resolve this by scrubbing the heights through a sampleTerrain function, which resulted in slightly different values, but still roughly 30m below the surface.

Is there a way to tell a position -> cartographicDegrees to clamp itself to the terrain?

Thanks,
Ben

Hi Ben,

I think you can use the CZML property HeighReference with the value
CLAMP_TO_GROUND

``

Thanks,

Gabby

Thanks for the suggestion. I've given that a shot. Appears to have no effect.

"position": {
    "interpolationAlgorithm": "LAGRANGE",
    "interpolationDegree": 1,
    "epoch": "2017-06-05T16:49:14Z",
    "heightReference" : "CLAMP_TO_GROUND",
    "cartographicDegrees": [
      0,
      -106.957785124,
      31.9563742261,
      1218.13,

Sorry I don’t have a czml example, but here’s the sandcastle demo for clamping to ground: http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Ground%20Clamping.html&label=Showcases, maybe the “Sample line positions” example is relevant?

Thank you for this help. My code to reset the heights of the path points wasn't using sampleTerrainMostDetailed. Now it is, and it's working like a charm. I really appreciate the help.

Great! I’m glad to hear its working!