I'm seeking some advice on how to build a simulation based on OpenStreetMap Data for my masterthesis. My knowledge of spatial data is very limited, since I come from another field of science, namely information systems. I have experience with object oriented programming, as well as mySQL as relational database.
The research goal is to evaluate if applications which inform the user of the current gasoline price actually have the potential to save money. So the idea is to simulate the routes people travel between their home and work by car and when the car needs gasoline to find the nearest gasoline station and refill. As Database I will use data from the www.zensus2011.de which can tell me from which administrative district people leave and to which administrative district they travel.
Within OSM I have the following Tags that can identify the administrative regions/districts which I need
- de:amtlicher_gemeindeschluessel => integer
- de:regionalschluessel => integer
- admin_level => 6
- boundary => administrative
So my idea is to use this data to generate random routes with a certain length based on other theses which describe how far people travel between home and work. One of the main problems which I could identify from reading the OSM wiki and other online posts is that the OSM data per se is not routable and needs to be transformed for that purpose. I for that I found two programs osm2pgrouting and OSM2PO. With the latter one I managed to import the map of Germany into a PostgreSQL Database. I also imported the OSM data using osm2pgsql with the "default.style" settings into another PostgreSQL Database. Now I'm a little overwhelmed by all the data and the way how to use this data.
But let's continue with the idea. What I need to understand now is how the map data with all the information and the routing data can be connected to generate the routes. What I thought of was: I use the administrative boundary to get a list of streets within this boundary, then randomly choose one as a starting point and do the same for the destination, calculate the route and save the route to a database for further use in the simulation. Still I need to find out a way to determine the start and destination points better, but for the beginning and understanding it would be fine with the above.
Some final words on the implementation of the simulation. Currently my plan is to use python and code the whole simulation, which I hope is feasible. I found two related works which I'm currently investigating namely MATSim and www.roaf.de. Also I'm still browsing other questions here which might help me understand the topic.
To summarize my questions:
- Is the way I choose feasible?
- How would SQL statements look like to connect the two Data sets?
- Is it possible to save generated routes to a database?