# Distance between 2 locations

**URL:** <https://community.glideapps.com/t/distance-between-2-locations/58448>\
**Category:** Ask for Help\
**Created:** [February 25, 2023, 1:06am UTC](https://community.glideapps.com/t/distance-between-2-locations/58448 "2023-02-25T01:06:08Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Munzer\_SATLI](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/munzer_satli/32/54896_2.png) [@Munzer\_SATLI](https://community.glideapps.com/u/Munzer_SATLI)\
**Post date:** [February 25, 2023, 1:06am UTC](https://community.glideapps.com/t/distance-between-2-locations/58448/1 "2023-02-25T01:06:09Z")

</div>

Hello everyone,

I want to creat a simulator giving a price, based on distance between origin and destination adress. The distance functionnality, implemented in glideapp isn’t accurate. sometimes, it’s more than 100km, or 8000km around.

I tried to implement the google maps API, unsuccessfuly. Here maps api too.

I tried openroute services, but still the same thing… can someone help me?

Thanks a lot 😉

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [February 25, 2023, 1:56am UTC](https://community.glideapps.com/t/distance-between-2-locations/58448/2 "2023-02-25T01:56:02Z")

</div>

Mapbox isn’t the greatest at geocoding addresses, but it helps to make sure the address is complete and clearly formed.

But to guarantee accuracy, the distance column works better if you give it coordinates instead of an address. So if you are looking to implement an API, I would look for something that just returns coordinates, and then use those coordinates as the address in your distance column.

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [February 25, 2023, 11:42am UTC](https://community.glideapps.com/t/distance-between-2-locations/58448/3 "2023-02-25T11:42:39Z")

</div>

Hola,

Do you want to know/work with the distance based on Driving, Walking, Cycling, etc?

If so, you have to use another way. Glide gives you the distance based on “as the crow flies” only.

Saludos!

---

<div class="post-metadata">

**Author:** ![Munzer\_SATLI](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/munzer_satli/32/54896_2.png) [@Munzer\_SATLI](https://community.glideapps.com/u/Munzer_SATLI)\
**Post date:** [February 25, 2023, 5:40pm UTC](https://community.glideapps.com/t/distance-between-2-locations/58448/4 "2023-02-25T17:40:29Z")

</div>

I will try it and give you my opinion 🙂

---

<div class="post-metadata">

**Author:** ![Munzer\_SATLI](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/munzer_satli/32/54896_2.png) [@Munzer\_SATLI](https://community.glideapps.com/u/Munzer_SATLI)\
**Post date:** [February 25, 2023, 5:41pm UTC](https://community.glideapps.com/t/distance-between-2-locations/58448/5 "2023-02-25T17:41:36Z")

</div>

I’m working with distance based on driving !

---

<div class="post-metadata">

**Author:** ![Munzer\_SATLI](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/munzer_satli/32/54896_2.png) [@Munzer\_SATLI](https://community.glideapps.com/u/Munzer_SATLI)\
**Post date:** [February 25, 2023, 5:51pm UTC](https://community.glideapps.com/t/distance-between-2-locations/58448/6 "2023-02-25T17:51:22Z")

</div>

I tried it, now, it’s more accurate, but still more than 50 km arround the real driving distance given by google maps or gere maps… that’s why i want to use another maps api, if it’s possible…

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [February 25, 2023, 5:54pm UTC](https://community.glideapps.com/t/distance-between-2-locations/58448/7 "2023-02-25T17:54:38Z")

</div>

The distance column in glide is straight line distance. It’s accurate as far as a straight line is concerned.

---

<div class="post-metadata">

**Author:** ![Munzer\_SATLI](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/munzer_satli/32/54896_2.png) [@Munzer\_SATLI](https://community.glideapps.com/u/Munzer_SATLI)\
**Post date:** [February 25, 2023, 5:57pm UTC](https://community.glideapps.com/t/distance-between-2-locations/58448/8 "2023-02-25T17:57:33Z")

</div>

So, how to resolve my problem? 🙂

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [February 25, 2023, 6:04pm UTC](https://community.glideapps.com/t/distance-between-2-locations/58448/9 "2023-02-25T18:04:45Z")

</div>

Ok!

If you want to use Google Sheet as data source and can wait a while to know the result (glide will need to do an update/sync), you might start over here [Google Maps Formulas for Google Sheets - Digital Inspiration](https://www.labnol.org/google-maps-sheets-200817)

If not, I have another solution using a script deployed as a web application: work as an API, you send parameter such as origin, destination and mode of travel (driving, walking, etc) and the script replies with the distance in 3-4 secs. It’s very fast and no API key is needed.

I hope it helps you.

Saludos!

---

<div class="post-metadata">

**Author:** ![Munzer\_SATLI](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/munzer_satli/32/54896_2.png) [@Munzer\_SATLI](https://community.glideapps.com/u/Munzer_SATLI)\
**Post date:** [February 25, 2023, 6:12pm UTC](https://community.glideapps.com/t/distance-between-2-locations/58448/10 "2023-02-25T18:12:05Z")

</div>

I’m not only looking for google maps solution. and like you said, it’s not interresting from google sheets.

I’m interrested by your solution 🙂

---

<div class="post-metadata">

**Author:** ![Munzer\_SATLI](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/munzer_satli/32/54896_2.png) [@Munzer\_SATLI](https://community.glideapps.com/u/Munzer_SATLI)\
**Post date:** [February 25, 2023, 6:55pm UTC](https://community.glideapps.com/t/distance-between-2-locations/58448/11 "2023-02-25T18:55:11Z")

</div>

How can you help me to do that?

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [February 25, 2023, 8:02pm UTC](https://community.glideapps.com/t/distance-between-2-locations/58448/12 "2023-02-25T20:02:36Z")

</div>

I sent you a DM my friend!

---

<div class="post-metadata">

**Author:** ![\_Lahan](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/_lahan/32/63610_2.png) [@\_Lahan](https://community.glideapps.com/u/_Lahan)\
**Post date:** [September 7, 2023, 3:43pm UTC](https://community.glideapps.com/t/distance-between-2-locations/58448/13 "2023-09-07T15:43:49Z")

</div>

Hi gvalero, I’m also interested in your solution.

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [September 7, 2023, 6:28pm UTC](https://community.glideapps.com/t/distance-between-2-locations/58448/14 "2023-09-07T18:28:38Z")

</div>

Hola!

Just a curiosity: The new Google Maps Integration doesn’t work for it?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/b/3bcba586c9791e9ae1ab09002f52247fdf54a7e7.png)

I used to use my workaround when this Integration didn’t exist but now, I’d suggest using it.

Is there something bad with it?

Saludos!
