# Car distance too short, shorter than geodesic straight line distance

**URL:** https://ask.openrouteservice.org/t/car-distance-too-short-shorter-than-geodesic-straight-line-distance/5864
**Category:** openrouteservice
**Created:** [March 6, 2024, 4:29am UTC](https://ask.openrouteservice.org/t/car-distance-too-short-shorter-than-geodesic-straight-line-distance/5864 "2024-03-06T04:29:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tobs40](https://ask.openrouteservice.org/letter_avatar_proxy/v4/letter/t/47e85d/32.png) [@tobs40](https://ask.openrouteservice.org/u/tobs40)
#### Post date: [March 6, 2024, 4:29am UTC](https://ask.openrouteservice.org/t/car-distance-too-short-shorter-than-geodesic-straight-line-distance/5864/1 "2024-03-06T04:29:05Z")

</div>

I set up a local openrouteservice instance with Germany as data, using the default settings. A look at the output of my program told me, that the ‘geodesic’ straight line distance, which I got from a widespread Python library, was 10-30% larger than the car distance, although this was only the case in around 1/3 of samples (I computed the distance matrices for N cities in Germany). Is this possible? Any idea what might be wrong? I am not sure what’s going on… Also I’m wondering that our research slides (just unimportant numbers and illustrations, but still though) are wrong because of this. Any hints would be much appreciated! 🙂

Best regards,  
Tobi

---

<div class="post-metadata">

### Author: ![sascha](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/sascha/32/715_2.png) [@sascha](https://ask.openrouteservice.org/u/sascha)
#### Post date: [March 6, 2024, 8:49am UTC](https://ask.openrouteservice.org/t/car-distance-too-short-shorter-than-geodesic-straight-line-distance/5864/2 "2024-03-06T08:49:43Z")

</div>

By its definition, the geodesic distance must always be shorter than the distance on the street network. So, what you are reporting, should not happen.

The first thing I would cross-check is whether the matrix contains distance or duration values (you can get both, independent of which one was used to find the optimal path).

Otherwise, I would cross-check the same requests with the public instance of ORS. If those still return wrong results, please post a complete request and response of a failing sample.

---

<div class="post-metadata">

### Author: ![tobs40](https://ask.openrouteservice.org/letter_avatar_proxy/v4/letter/t/47e85d/32.png) [@tobs40](https://ask.openrouteservice.org/u/tobs40)
#### Post date: [March 22, 2024, 4:12am UTC](https://ask.openrouteservice.org/t/car-distance-too-short-shorter-than-geodesic-straight-line-distance/5864/3 "2024-03-22T04:12:12Z")

</div>

After veeeery intense search, I found that I switched latitude and longitude in a complicated way. Advice to people: Don’t use tuples for latitude, longitude - use dictionaries or a small class!

---

<div class="post-metadata">

### Author: ![jschnell](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/jschnell/32/971_2.png) [@jschnell](https://ask.openrouteservice.org/u/jschnell)
#### Post date: [March 22, 2024, 7:12am UTC](https://ask.openrouteservice.org/t/car-distance-too-short-shorter-than-geodesic-straight-line-distance/5864/4 "2024-03-22T07:12:11Z")

</div>

Hey,

great that you were able to sort it out 🙂

Best regards
