Distance calculation: what algorithm/formula is used?
The Utility Functions : Distance Calculation
is used to calculate the distance between 2 points (with lat/lng).
But it didn't use the Google Map API or tools like that, so which algorithm/formula is used to calculate the distance ? Vincenty ? Haversine ?
It has an important stake in precision, that’s why it interests me
Thanks in advance
Best Answer
-
@Kat I guess Xano uses neither Haversine nor Vicenty, though it's very close to Haversine. Maybe Xano is using the Haversine formula but rounding off a few decimals at some point.
It is easy to test by comparing the results with online calculators. For example, let's calculate the distance between the following two points.
(48.857461 N, 2.291029 W) and (48.857461 N, 2.304698 W)
Xano: 999.9595481786212
Haversine: 1000
Vicenty (GRS80 or WGS84): 1003.036
Vicenty (ANS): 1003.04
Vicenty (International 1924): 1003.084
Here are the online calculators I have used:
Answers
-
?
-
hey Kat this is a xano product question and they are an American company on holiday for a long weekend (Labor Day). Be patient and they will get back to this in the coming week! I’m curious about the answer too!
-
Hello Xano Team, do you have an answer to my question please :) ?
-
thanks @arturosanz
Do you have an alternative to formulas.
A free Google map distance calculation or something like this just to have more precision. I know mapbox api let you a large number of requests before paying.
The difference between formula and api service is they do not take into account the roads, obstacle …
I know there is more complexe formulas they took the rounding of the earth, … I’m just asking :& -
What is your use case in particular @Kat? What do you need the distance calculation for?
Categories
- All Categories
- 46 📣 Announcements
- 47 🦾 Releases
- 36 👋 Welcome
- 924 🤷 Help! I'm a Noob
- 113 📱 No-Code Front-Ends
- 597 🌐 Working with APIs
- 418 🔢 Transforming data
- 120 🔌 Connect Xano to ...
- 46 🧑💻 Find an Expert
- 320 ❓Other questions
- 32 🔐 Security
- 22 ✂️ Snippets
- 19 🏆 Showcase
- 7 🗣️ Xano Chatter
- 60 📺 Video Tutorials
- 166 🙏 Request a feature
- 219 🐞 Report a Bug
- 19 🚀 Templates & Extensions
- 6 💬 Feedback