This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

[closed] Shortest path using A* with nodes and ways

-1

I'm trying to create a web application that given two points : S(lat,long) and D(lat,long), find the shortest path between them.

My problem is : I do not know how to use A* or other AI algorithm to find the shortest path given the nodes and ways from here : "http://overpass.osm.rambler.ru/cgi/interpreter?" and after that reconstruct the solution, building the path in the map. I'm using Overpass API to get the nodes and ways, using an approach by "rectangle" between the geo points(i know this is bad, because you can have a shortest path the is not in this rectangle, but i do not see a better solution with this API). This is a paper I must make to AI course in my university.

Short Version :

  1. Anyone knows how to make shortest path algorithm using A* with given nodes and ways?
  2. Anyone knows which nodes and ways to get? I'm using the approach to get nodes and ways inside the rectangle between the Start and Destination points, but it does not work with points in the same line.

Thank you.

asked 15 Apr '15, 21:09

Mixxer's gravatar image

Mixxer
10113
accept rate: 0%

closed 15 Apr '15, 22:34

mmd's gravatar image

mmd
5.7k15388

The question has been closed for the following reason “Question was cross posted on stackoverflow.” by mmd 15 Apr ‘15, 22:34

Source code available on GitHub .