Latitude and Longitude of Path from A to B

4 views (last 30 days)
czeslaw
czeslaw on 21 Dec 2017
Commented: New to matlab on 24 Apr 2021
Hi all,
Is there a premade function in Matlab that can gives sets of latitude and longitude of the shortest possible routes (like GPS) from one place to another (represented also as latitude longtitude)
So the input is:
Latitude and Longitude of a place A
Latitude and Longitude of a place B
The output is:
set of latitudes and longitudes of route 1 from A to B in a matrix
set of latitudes and longitudes of route 2 from A to B in a matrix
set of latitudes and longitudes of route 3 from A to B in a matrix
etc.....
The number of points of latitudes and longitudes in the output would depend on another input that describe how details the output would be.
Might be very complex things to do.
Thanks a lot in advance for any suggestion.

Answers (1)

Walter Roberson
Walter Roberson on 21 Dec 2017
No, there is no such premade function.
However, you can use the Mapping Toolbox function distance() which can calculate distances between points on a reference spheroid (though it does not appear to know anything about elevation.) Once you have those distances, you can use the MATLAB function graph() to create a graph object, after which you can use shortestpath() to find shortest path along the graph.
  1 Comment
New to matlab
New to matlab on 24 Apr 2021
Thank you for the answer.
so after finding the shortest path using graph displays. do do you have a way to extract latitude/longitude data (of that path) ?

Sign in to comment.

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!