I have a Google map area for which routing is undefined. It is the campus for my university. I want to some two more buildings to it and some polylines to define the roads as the roads are not shown on the map. Then I will apply A* algorithm to find the shortest route between one polyline to the other. The map will be available to an android application for mobile. In its basic state the application updates the location of the user. The user can request to go to the faculty of engineering for example. Now how will I know where he is, i mean what is the source for the route, the closest polyline? Is this the way things are done? Thank you.
Share
Use OpenStreetMap data; you can join OSM as a contributor and add buildings, roads and other things to the map. OpenStreetMap is a sort of Wikipedia but with maps, not encyclopaedia articles.
Download and process the OpenStreetMap data for your campus: get all the polylines usable as routes; sort their points; identify points common to more than one polyline – they are nodes; create a directed graph of arcs joining these nodes.
Implement the A* algorithm using the directed graph. A* is definitely the best algorithm to use; fast, correct and well documented.
Use a GPS device (on which your code is running) to find out where your user is. GPS gives positions in lat/long; OpenStreetMap data is also in lat/long; so that should work fine.
This will naturally involve some research and hard work. I guarantee it will do what you want, because I have done this myself (commercially – I won’t link to my product because I have been rapped on the knuckles for that; but I naturally claim that doing something commercially imposes a certain discipline). There is plenty of open-source software to help with these things. In particular, the A* algorithm is explained very well on Wikipedia.