I realize there are a lot of routing engines already developed for OSM but wanted to post my own that I developed over the last few months. I have a VS2010 project up on SourceForge here (compiled on windows platform): https://sourceforge.net/projects/osmexplorer/files/. The project includes an example data file for my home state of Oregon, USA that the routing engine runs off of (along with spatial queries of individual road segments). OSM or MapQuest tiles are downloaded by the app for rendering. I’m not a developer (code mostly for school and fun) so there are definitely plenty of bugs and some messy code I’m still cleaning up. I did take the time to comment the public classes and members. My intent is to (someday) turn this into some sort of SDK. I know OsmSharp already exists, this is just my own crack at working with OSM data :).
In the interest of citing other work I used:
-Routing Engine: based on HBA* algorithm (arc-based, i.e. “Shooting-Star”, to better support turn costs), see this paper: http://www.icsi.berkeley.edu/pubs/techreports/TR-09-007.pdf. Currently supports distance, travel time, stop sign and traffic signal costs. Soon will add turn restrictions (it will make u-turns in some unusual places on occasion). Vehicle restrictions are currently flagged in the database, however I haven’t yet implemented them in the routing engine. Also does not yet output driving directions.
-Map rendering: based on C# project by Ciaran Gultnieks (not sure if on this forum or not) http://projects.ciarang.com/p/csmapcontrol/
-Spatial database: Using Volante embedded OO database by Krzysztof Kowalczyk (http://blog.kowalczyk.info/software/volante/database.html) with custom data file (created myself, very crudely). Currently the database is reasonably fast (routing engine can calculate most routes within Oregon in less than 1s, depending on data caching) but still has a lot of junk I need to clean up to reduce the size of the file. Once I get my data file parser working a little better I will upload that as a separate project so any OSM file can be parsed. I had too much trouble getting other file parsers to work in windows so I just made my own. It’s reinventing the wheel but I learn a lot more this way ;).
Anyway I welcome any feedback or contributions. I’m new on SourceForge so I haven’t yet learned how to do version control and conform to other development practices (again not a developer), but I’ll try to keep things sorted reasonably well as I make updates in the future. Thanks!
Edit: Forgot to mention some posts on Eric Lippert’s MSDN blog (highly recommend for .NET programming advice) that covered the basics of implementing A* in C# here: http://blogs.msdn.com/b/ericlippert/archive/2007/10/02/path-finding-using-a-in-c-3-0.aspx. The immutable Path class and PriorityQueue greatly improve performance!