Polyline with altitude ground behavior tool and question

Hi,

I noticed that the behavior of polylines whose endpoint is elevated above ground appears to have been discussed in s community post and that that post referenced this issue. The issue is open, but I thought I’d mention them here in case there’s a quick solution to what I’m seeing now.

When I map polylines in czml that have enpoints or midpoints with a non-zero altitude, their initial point on the ground, demarked with altitude 0 as shown below, doesn’t clamp to the ground. Here’s an example of a polyline definition:

{
    "id":"f2n7wpo",
    "name":"n7wpo",
    "description":"<H2>n7wpo</H2><table><tr><td>datetime2 = 2025-02-16T02:09:28</td></tr><tr><td>rst = 559</td></tr></table>",
    "polyline":{
      "positions":{
        "cartographicDegrees":[-122.39556128064362,37.79932829961188,-5, -122.77430903389264,42.95907274855483,301000]
      },
      "material":{
        "solidColor":{
          "color":{
            "rgba":[0,255,0,255]
          }
        }
      },
      "show":[
          {
              "interval":"2025-02-16T02:08:28Z/2025-02-16T02:08:46Z",
              "boolean":true
          }
      ],
      
      "width":5,
      "relativeToGround":true
    }
  },

You can see the behavior on this map .

When you zoom in, notice that the polylines that ascend into space are not on the ground.

In this example, the polylines were orignally below ground when specified with a 0 altitude starting point:

Is there a flag to set for polylines that will clamp their origin point to ground level?

In the mean time, I used ChatGPT to develop JavaScript code that provdies altitude adjustment so I can move the lines up or down till they do start on the ground, and then save the updated czml. Here’s a video of the code in action.

Thanks,
Hamilton Carter

Hi @antigrav_kids, I’m seeing some issues and threads that make me question whether KML is working at all with “relativeToGround” and a terrain.

Can you verify this on your end? If your KML specifies a constant height of (say) 10m, does it follow the terrain at all? If not, you could open an issue in the repo.

Your altitude adjustment code is an impressive workaround!

Thanks @jjhembd !

I should have been more clear. For use with Cesium, I’ve switched all my maps over to czml. I do see now that the issue referenced might have been discussing using JavaScript to work around a kml issue.

The behavior I’m seeing though, is generated by a czml map read into Cesium.

Best Regards,
Hamilton Carter