Driving distance between addresses

Does anybody know of a way to get the driving distance between two addresses in Coda? I’m guessing it’s not possible using just Coda?

Thanks!

hi @Allen_Ormond1 , indeed this is not yet possible for it requires Google Directions.

There is an experimental function that is visually appealing and has the very same name, but does not deliver the output (driving time, driving distance) as number or text, It is GoogleDirections()

It is rather easy, it shows a map.

best, Christiaan

Hey @Allen_Ormond1 ,

I’ve been tinkering with the Pack SDK yesterday, and have built a pack that gives you the distance between 2 addresses in a formula.

Link: Coda | Driving Distance
Demo Doc: Road Trip Planner

Wondering if this is what you’re looking for.

Thanks,
-K

4 Likes

hi @Kenny , thanks for the input

in Coda we already have the function Distance() and Location()

Distance​(location1, location2, unit​)

Returns the distance (in kilometers) between two locations (lat/long) on earth using the Haversine formula. I guess you used this one:

The driving distance requires access to a specific and expensive API.

Cheers, Christiaan

1 Like

Yup! The distance from the pack is the driving distance (& duration) between two locations - Rather than what was returned from Distance(...) formula.

hi @Kenny , thx!

I did not notice that you return the distance in miles, we use the metric logic (Km). Once I know this, we can work around it (but adding the Km option would be wonderful, I did not see how to do it).

concerning the time, it is a driving time that does not take into account the traffic itself, right?

merci, Christiaan

1 Like

I got it based on your example!

this is super and will work very well in many cases, merc!

2 Likes

RE: Showing metrics (Meters) vs versus miles

  • Looks like you found it!
  • I did notice the inline documentation is unclear - Thanks for letting me know, I’ll update it to make it more clear.

RE: Driving time - Does it account for traffic?

  • No, real-time traffic info is not available at the moment. :disappointed:
  • For my understanding - How do you plan to use the Driving Time if traffic information is available?

(A bit of context around why I created the formulas: I use Coda for road trip planning, and the function mainly helps me figuring out how I should account for driving time per day. On the day of the road trip, I’ll usually check for real-time traffic in the morning & between each stop, and adjust my plan accordingly.)

1 Like

it is wonderful contribution @Kenny ,

the driving time would be rather practical for alerts, but since we have already the distance and normal driving times, it all works for well for me. I do some work for transportation companies in Coda and distance (fuel, etc, driving time) plays an important role. Your tool will save me some time!

many thx again, cheers, christiaan

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.