Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Distance between two sets of Lat / Longs

RogerA
8 - Asteroid

Hello, i am trying to figure out how to calculate the distance between set sets of lat / longs.  In excel i would use the following formula.  C2,G2 (Y Coord), D2,H2 (X Coord) are cell references, and i'm calculating distance in nautical miles hence the 3440.65.

 

=ACOS(COS(RADIANS(90-C2))*COS(RADIANS(90-G2))+SIN(RADIANS(90-C2))*SIN(RADIANS(90-G2))*COS(RADIANS(D2-H2)))*3440.65

 

How would i go about doing this in alteryx?

 

Thanks in advance!

6 REPLIES 6
LordNeilLord
15 - Aurora
Hey @RogerA

Have a look at these two tools... They're pretty straightforward:

Create points (to convert lat /lng to spatial points) https://community.alteryx.com/t5/Alteryx-Knowledge-Base/Tool-Mastery-Create-Points/ta-p/36653

Distance (to find the distance between spatial points) https://community.alteryx.com/t5/Alteryx-Knowledge-Base/Tool-Mastery-Distance/ta-p/87210

Hopefully you'll get the idea
derekbelyea
12 - Quasar

Here is a small example:

 

2018-02-25_00014.png    

 

2018-02-25_00015.png

 

 

2018-02-25_00012.png

RogerA
8 - Asteroid

Both replies are really useful, i'm going to look at these today and i'll let you know if I have managed to get my data sorted out.  Thanks!

RogerA
8 - Asteroid

Thanks very much, using these examples i was able to make my two sets of lat/longs spatial points, and then convert to nautical miles using a simple formula.  Thanks!

RogerA
8 - Asteroid

I found a really simple way to do this, and just turned my two sets of lat/longs into centroids, join them back into the data, use the distance tool and its done!   The formula converts miles into mautical miles for what i'm doing as nautical miles is not a standard measure in the distance tool.

 

 

Anshul_Bajpai12
5 - Atom

Using latitude and longitude to get the distance between the two regions gives point to point distance rather than the by road distance. So is there a way to get the by road distance between two points.

Labels
Top Solution Authors