Distance between two sets of Lat / Longs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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!
Solved! Go to Solution.
- Labels:
- Spatial Analysis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
