[GIS] How to route on OSM without using any already released routing engine

openstreetmaprouting

I'm a computer science student and a complete beginner in GIS and stuff. I'm trying create my own web-based multi-modal journey planner as my thesis. And as it is a thesis I can't use any ready-made routing engines like graphserver or opentripplanner, etc. though I can use third party applications for data conversions, like map data into SQL or KML, etc. I've done some research and this what I've learned so far.

  1. that I can download map data from OpenStreetMap (OSM) and convert them into SQL like SQLlite or PostgreSQL for querying. (in RTree index structures)
  2. that I can also convert GTFS data into SQL, again for querying.
  3. that I can link those two data sets through stops (those loading and unloading stations for each mode of transit).
  4. that I should convert those two data sets into a graph then link them in order to perform multi-modal routing. (I don't know if there are other solutions)
  5. that I can convert the resulting route into KML so I can overlay/display them on Google Maps or other API's, for presentation. (forgot where I read this, but I know I read about this somewhere)

My question is how can I convert an OSM database into a graph data… How can I perform routing on those graph data… this is where I got lost, I still don't know how can I perform routing algorithms from those given data sets as input/source. I tried reading the source code of graphserver, but it did no good to me… besides it needs to be in Linux system to work, and I'm currently working on Windows… I have few understanding on Java… but if I have to, I can learn it, if it is what it takes so I can grasp the steps in performing routing. (as I see.. most of the routing engines are written in Java)

Best Answer

SpatiaLite has routing support, and its probably a bit easier to understand than some of the "bigger" engines. See the docs. More searching, following links, reading the code and so on will help you to understand this, and given your stated needs, I won't provide step-by-step instructions here.

I understand that you don't want a canned solution, but I think you may benefit from looking at a simple working system.