# Calculate km CZML path

**URL:** <https://community.cesium.com/t/calculate-km-czml-path/5924>\
**Category:** CesiumJS\
**Created:** [August 7, 2017, 10:00am UTC](https://community.cesium.com/t/calculate-km-czml-path/5924 "2017-08-07T10:00:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![frodrigues.vexiza](https://avatars.discourse-cdn.com/v4/letter/f/958977/32.png) [@frodrigues.vexiza](https://community.cesium.com/u/frodrigues.vexiza)\
**Post date:** [August 7, 2017, 10:00am UTC](https://community.cesium.com/t/calculate-km-czml-path/5924/1 "2017-08-07T10:00:30Z")

</div>

Hi,

I was looking at this example[https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Callback%20Property.html&label=Beginner](https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Callback%20Property.html&label=Beginner),

but this is for a polyline, how can I do it for CZML.

I want to show the km of the path in a label as in the following image.

[![](https://lh3.googleusercontent.com/-vJ7ub51why8/WYg5FMYuQQI/AAAAAAAAAAM/f-ng-IiZQrQ-_ZMGlGoiixDsApWKcPWYACLcBGAs/s320/Captura.PNG)](https://lh3.googleusercontent.com/-vJ7ub51why8/WYg5FMYuQQI/AAAAAAAAAAM/f-ng-IiZQrQ-_ZMGlGoiixDsApWKcPWYACLcBGAs/s1600/Captura.PNG)

Regards.

---

<div class="post-metadata">

**Author:** ![Rachel\_Hwang](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@Rachel\_Hwang](https://community.cesium.com/u/Rachel_Hwang)\
**Post date:** [August 8, 2017, 2:09pm UTC](https://community.cesium.com/t/calculate-km-czml-path/5924/2 "2017-08-08T14:09:35Z")

</div>

Hi there,

Once your CZML s loaded, you can use either EllipsoidGeodesic ([https://cesiumjs.org/Cesium/Build/Documentation/EllipsoidGeodesic.html](https://cesiumjs.org/Cesium/Build/Documentation/EllipsoidGeodesic.html)) or the distance function in Cartesian3 ([https://cesiumjs.org/Cesium/Build/Documentation/Cartesian3.html](https://cesiumjs.org/Cesium/Build/Documentation/Cartesian3.html)) to measure length, depending if you want to measure distance along the ellipsoid surface or just point to point.

Cesium loads all data as Entities, so it’s just a matter of getting the point data (your CZML may just load a polyline!) and measuring using one of the above methods.

Hope that helps,

- Rachel
