# GIS Utility Functions

**URL:** <https://community.cesium.com/t/gis-utility-functions/37618>\
**Category:** Cesium for Unreal\
**Created:** [December 27, 2024, 11:14am UTC](https://community.cesium.com/t/gis-utility-functions/37618 "2024-12-27T11:14:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![milansoliya](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/milansoliya/32/27426_2.png) [@milansoliya](https://community.cesium.com/u/milansoliya)\
**Post date:** [December 27, 2024, 11:14am UTC](https://community.cesium.com/t/gis-utility-functions/37618/1 "2024-12-27T11:14:30Z")

</div>

Is there any function or method available in cesuim unreal or cesuim native as mentioned below ?

1. Distance between two cartographic point like` double GeodeticDistance(double lon1, double lat1, double lon2, double , lat2)` ?
2. Forward Azimuth between two cartographic point `double ForwardAzimuth(double lon1, double lat1, double lon2, double , lat2)` where out would be 0-360 from true north in degree ?
3. Geodetic Point calculation from distance and azimuth from reference point like `GeodeticPoint(double lon, double lat, double distance, double azimuth, double resultLon, double resultLat)` ??

While considering Earth Model like Ellipsoidal or Spherical ?

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [January 7, 2025, 3:14am UTC](https://community.cesium.com/t/gis-utility-functions/37618/2 "2025-01-07T03:14:16Z")

</div>

Hi @milansoliya, welcome to the community!

We don’t currently have such functions in Cesium for Unreal.

You can find an open-source implementation of the first of these in CesiumJS:

> <https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/EllipsoidGeodesic.js>

That’s assuming your want the geodesic distance, which is the shortest distance between the points over the ellipsoid surface. You would create an instance of this class and then access the `surfaceDistance` property.

For the other two, I’m assuming you want a “constant azimuth” path, which forms a rhumb line, rather than the shortest geodesic path. If so, CesiumJS’s `EllipsoidRhumbLine` class will help:

> <https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/EllipsoidRhumbLine.js>

For (2), you would construct an instance of this class by passing the two points to the constructor, and then access the `heading` property. For (3), you would construct an instance using `fromStartHeadingInstance` and then access the `end` property.

All of this is in JavaScript, so not usable directly, but it could be ported to C++ for use in Unreal Engine. We’d welcome a pull request for that if you’re up for it!
