Adding KML Path

How should I approach overlaying a path, exported from Google Earth in KML, on top of the Google Photorealistic Tiles Set?

I’ve tried the following so far:

    • I converted the KML to dxf in ECEF coordinates. Then I added the dxf to my scene, but the path did not appear in the scene. There was a representation or placeholder for it at the origin, but no path wasvisible. I tried removing the Google Tiles in case it was occluding the path, but there was still no path visible.
    • I converted the KML to GML, uploaded it to Cesium Ion, and then added it as a tileset in Unity. It was added to my scene, but again I only saw a placeholder.
    • I tried with a few other file formats that are not yet supported in the Cesium Unity plugin.

I know the KML is not corrupted and the path is defined in it properly because the converted GML is displayed in the Cesium Ion preview window.

Any help is greatly appreciated.

Thanks,
G

Hi @golgo32, welcome to the community!

There is currently no built-in way to do this. I think if I were to do this myself, I would try converting the KML to an easy-to-parse format like GeoJSON. Then I would read that GeoJSON from a Unity script (perhaps using a third-party GeoJSON reader, or perhaps just by directly reading it as JSON) and add each point to a Unity spline. Static methods on CesiumWgs84Ellipsoid and instance methods on CesiumGeoreference will be helpful for converting each longitude/latitude to Unity world coordinates. You may also need to use the SampleHeightMostDetailed method on Cesium3DTileset if the original KML does not already includes heights.