-
Notifications
You must be signed in to change notification settings - Fork 1
3. Building and Running Open Trip Planner
The objective of this script is to create a graph file on the server, load the additional required files and then create transit time tables. The script is based on performing the analysis on a redhat server but should be easily transferable.
Before beginning you will require:
For the following to work, it is necessary that the Java 8 JDK is installed and available.
- Within the open trip planner directory create a new file based on year and timetable period. For example, 2016_jul. You should set this as the working directory.
- Within the directory create a new file called graphs and within this create a file called gb. This file will be used to store the Open Trip Planner graph on completion.
mkdir -p graphs/gb
- From the home directory, copy the ITN data, otp-1.2.0-shaded.jar and python-standalone-2.7.0.jar file.
- Upload the GTFS files in a zipped folder. (I called the compressed file test.gtfs.zip which worked.)
Having completed the above, the directory should contain five files files. It is now possible to create the graph file.
- In terminal, navigate to the directory. The following command will search for the GTFS and ITN street network.
java -Xmx2G -d64 -server -jar ../otp-1.2.0-shaded.jar --basePath . --build .
The graph building process should take in the region of 3 minutes. In this case, the file was around 600Mb.
- Move the Graph.obj file the has been created into the gb directory within the graphs directory.
mv Graph.obj graphs/gb/Graph.obj
- Once the graph has been constructed, the .osm ITN file is no longer required. This can be removed to avoid duplication of files.
- In the home directory create an empty directory called results. This will be used to store the outputted transit data.
- Upload the split origin and destination data for the appropriate year. The most efficient approach to achieve this is to split the file and then uplaod the data in a zipped format. This can be unzipped using terminal.
unzip split_od_data.zip
- Once unzipped, the file should be renamed as OD_lists.
mv split_od_data OD_lists
Note: Zipped copies of the OD_lists are available on the IHM server in Data > OTP_origin_destination_data folder.
- A pro forma script is provided for the routing in the Accessibility Analysis directory. Based on the year being analysed, the following parameters should be changed.
- The year should be updated to reflect the year for which the data being analysed. In the pro forma script the year is set as 2013.
- The date which the calculation is being performed for should be updated. Note, each timetable has a very limited window of validity. Details of the dates covered can be found in the calendar file within the GTFS file.
- The file should be saved to reflect the date for which the analysis will be performed.
- The python script should be saved in the top directory for the timetable period (<year_month>)
With the data prepared and python script refactored, it should then be possible to execute the script. From the Timetable period directory, execute the following script.
java -cp ../otp-1.2.0-shaded.jar:../jython-standalone-2.7.0.jar org.opentripplanner.standalone.OTPMain --script IHM_qy_accessibility_split_loop_2015_oct.py
The output of this script will be written to the home directory into the results folder.
The following work has been completed as part of the Inclusive and Healthy Mobility project at UCL. For further details about the project can be found here.
ESRC Project Code: ES/P010741/1