# Got route distance 0 between two different GPS locations?

**URL:** <https://discourse.julialang.org/t/got-route-distance-0-between-two-different-gps-locations/30291>\
**Category:** General Usage\
**Created:** [October 25, 2019, 7:25am UTC](https://discourse.julialang.org/t/got-route-distance-0-between-two-different-gps-locations/30291 "2019-10-25T07:25:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Post date:** [October 25, 2019, 7:25am UTC](https://discourse.julialang.org/t/got-route-distance-0-between-two-different-gps-locations/30291/1 "2019-10-25T07:25:44Z")

</div>

I have two longitude, latitude pairs in coding, which are randomly generated as the following.  
location 1: (39.655994758358524, 56.54323616733745)  
location 2: (32.44297771882851, 68.10900336760139)  
I need to calculate a route between these two positions. Well, I’m facing this route-nodes-length-0 issue. In real world, cars can always go from any given location A to location B. In the modelling, many (if not all) shortest-path algorithm will return 0 if no shortest-path can be found. I guess it is because directed graph is considered and because the map is only a partial map of the real world, and if the two locations are along / near the boundary, then no directed path can be found, not to mention shortest-directed-path. I was wondering, under this situation, say, in my model, I need to work on simulated experimental data (randomly generate two locations from the map), and the shortest-route I found has no nodes. In this case, how to proceed based on your opinion. PS: the julia package I’m using is OpenStreetMapX and OpenStreetMap. Any comments are greatly appreciated.
