Several databases will offer you some GIS functions, hence look at those.
If you want to compute using SQL expressions, if your system has the trig functions.
The distance between lat and long points can be derived using the Haversine formula
DEGREES(ACOS(COS(RADIANS(lat1)) * COS(RADIANS(lat2)) * COS(RADIANS(long1) - RADIANS(long2)) + SIN(RADIANS(lat1)) * SIN(RADIANS(lat2))))
Multiplying value by constant to change units
- Kilometers = 111.045
- Meters = 111045.0
- Miles = 69.0
------------------------------
NIGEL CAMPBELL
------------------------------
Original Message:
Sent: Tue May 25, 2021 10:16 PM
From: Chris Adams
Subject: Calculating distance between 2 Lat Long coordinates
Hi,
I am sure this has been discussed previously, but I cannot seem to find anything.
We have 11.1.7 installed, I am wondering is there is a way to calculate the distance (as the crow flies) between 2 GPS locations within Cognos ?
Thanks in advance,
------------------------------
Chris Adams
------------------------------
#CognosAnalyticswithWatson