OHDM Traveler allows to create a route between a start and an end point under consideration of a given date in a OHDM DB. This project is based on the bachelor thesis written by Kirill Mishin.
The idea is that in the future the route can be calculated under consideration of historical events. At the moment two different types of persons (Noble and Farmer) are implemented to show an example of a route calculation under consideration of historical events. Restricted areas can be set to represent Pest zones, the Nobel will be informed of the Pest zone and therefore avoid them. On the other hand the Farmer is not informed and will traverse them.
-
Download any osm file, you can find a small sample on our repository (sample.osm).
-
Download the JDBC driver.
-
Create these files: "intermediate.txt", "ohdm.txt", "rendering.txt".
- The format these files have to follow is described here.
-
Create a Postgres DB with these extensions:
-
Create these schemas: ohdm, intermediate, rendering.
-
Create the intermediate DB.
-
Create the OHDM DB.
-
Create the Rendering DB (use -r option).
- Clone this repository or Download the precompiled jar under releases
- Create a schema in your Postgres DB where the routing results will be stored (routing for example).
- Under src/main/config you will find two example csv files, odhm_parameter_example.csv and search_parameter_example.csv. Insert in the second row of both files the required information, you can find more info about this under Parameters.
- Run jar or
- Set in build.gradle
mainClassName="traveler/TravelerMain.java"
- Run with gradlew
gradlew run --args="-r [path to ohdm_parameter.csv] -s [path to search_parameter.csv]"
- Optionally debug mode can be run with:
-d [true/false]
- The results will be stored in the routing schema.
- Clone this repository or Download the precompiled jar under releases
- Create a schema in your Postgres DB where the routing results will be stored.
- Under src/main/java/config ythis csv file odhm_parameter_example.csv. Insert in the second row the required information, you can find more info about this under Parameters.
- Run jar or
- Set in build.gradle
mainClassName="traveler/RestTravelerMain"
- Run with gradlew
gradlew run --args="-r [path to ohdm_parameter.csv]"
- Optionally debug mode can be run with:
-d [true/false]
- REST Server waits for POST request With JSON Body
- REST Server replies with JSON
{"classofperson": "farmer", "transporttype": "bicycle", "waterwayincl": "true", "startpoint": {"latitude": "52.457907", "longitude": "13.527333"}, "endpoint": {"latitude": "52.444784", "longitude": "13.507886"}, "day": "2019-12-1", "restricted_area": {}}
{"travel_time":"00:16:52.46232","request_id":"f84ff5dcc3dc4ecb85129c9fba05891e"}
"odhm_parameter.csv" has to follow this format:
host | port | username | password | dbname | schema | rendering_schema |
---|---|---|---|---|---|---|
host IP | port number | username | password if required | name of the DB | name of scheme where results will be saved | name of schema where rendering tables are stored |
host | port | username | password | dbname | schema | rendering_schema |
---|---|---|---|---|---|---|
localhost | 5432 | admin | superPassword | OHDM | routing | rendering |
"search_parameter.csv" has to follow this format:
classofperson | transporttype | waterwayincl | startpoint_latitude | startpoint_longitude | endpoint_latitude | endpoint_longitude | day |
---|
This is only for illustration, should follow csv format!
classofperson: [1, 2] (1 will traverse restricted areas, 2 will avoid them)
transporttype: [Walking, Horse, Carriage, Car, Boat, Bicycle] (Case insensitive)
waterwayincl: [true,flase]
startpoint_latitude: [startpoint latitude]
startpoint_longitude: [startpoint longitude]
endpoint_latitude: [endpoint latitude]
endpoint_longitude: [endpoint longitude]
day: [YYYY-MM-DD]
classofperson | transporttype | waterwayincl | startpoint_latitude | startpoint_longitude | endpoint_latitude | endpoint_longitude | day |
---|---|---|---|---|---|---|---|
2 | walking | false | 52.457907 | 13.527333 | 52.461204 | 13.513603 | 2019-12-1 |
If you get 0:00 as result_time no route could be found for your request. In this case check the search_parameter (especially day and transporttype). It could also be helpful to look at the routing_topology table in your routing schema. If the table has to many entries, it might be helpful to only look at a certain area. The following SQL command could be useful in this case:
SELECT * from <routing_schema>.routing_topology where ST_Y(st_transform(ST_Centroid(line), 4326)) > lat1 and ST_Y(st_transform(ST_Centroid(line), 4326)) < lat2 and ST_X(st_transform(ST_Centroid(line), 4326)) > lon1 and ST_X(st_transform(ST_Centroid(line), 4326)) < lon2;