Custom Map With Directions
Question
I want to make a map program that gives directions around a campus (residence halls, football field, etc), and within buildings (to offices, cafeteria, etc). Is there anything existing that would help facilitate that?
The alternative seems to be that I would have to create my own map of points and paths around campus and do path-finding for directions.
EDIT: To clarify, I'm wanting to know about how to add spatial awareness to a pathfinding program, in order to generate walking directions for the path. Example: for a hallway full of offices that has two nodes that allow a path to enter the hallway, how do you know if a certain office is on the left from one node and on the right from another?
Solution
If I use polygons for the nodes instead of waypoints, I can create a navigation mesh that can be used for pathfinding and directions. For directions and using a rectangle node, if I give the rectangle numbers for its sides from 1 to 4 going clockwise from the top, I know that if I enter side 2 and leave side 1, it's a right hand turn. Or, if I enter side 3 (say, the bottom) and leave side 4, it's a left.
OTHER TIPS
This is pretty hard to answer without knowing what sort of interface you want. Is it supposed to be a Google Maps-type application? Or something simpler? No matter what you're probably going to have to define paths - what things are impassable.
You could do a lot of work and define what's impassable and then use a path-finding algorithm to walk across lawns; but that'd be more work than the simple approach:
- Make a map of campus with all the routes greyed out
- Define the points and paths in PHP/Perl/Ruby/Python/Coldfusion/ASP.Net/Whatever
- Get the Start and Destination from the user
- Run Dijkstra's Algorithm
- Display the map of campus with overlays highlighting the route segments to light up their path.