# Prepare host * create user like [this](https://git.wtf-eg.de/dancesWithCycles/setup/src/branch/main/doc/gnu-linux-create-user.md) * If required, install java like [this](https://git.wtf-eg.de/dancesWithCycles/setup/src/branch/main/doc/java.md) * If required, install git like [this](https://git.wtf-eg.de/dancesWithCycles/setup/src/branch/main/doc/git.md) * If required, install maven like [this](https://git.wtf-eg.de/dancesWithCycles/setup/src/branch/main/doc/maven.md) # GTFS source file * checkout [repo](https://github.com/OneBusAway/onebusaway-gtfs-modules.git) (ATTENTION: alternative download link for [onebusaway-gtfs-transformer-cli](http://developer.onebusaway.org/modules/onebusaway-gtfs-modules/1.3.4-SNAPSHOT/onebusaway-gtfs-transformer-cli.html)) ``` git clone https://github.com/OneBusAway/onebusaway-gtfs-modules.git ``` * build tool ``` cd onebusaway-gtfs-modules mvn clean package ``` * download GTFS data ``` wget -o ./wget-log-connect-ls-top-dhid.txt -O ./connect-ls-top-dhid.zip http://www.connect-info.net/opendata/gtfs/connect-nds-toplevel-dhid/ ``` * generate GTFS extract (ATTENTIONS: If server host has not enough main memory download the extract from development host and continue with OSM section.) ``` cd mkdir java -Xms20G -server -jar onebusaway-gtfs-transformer-cl-.jar --transform=./connect-ls-top-dhid-retain-bsag.txt connect-ls-top-dhid.zip ``` * archive GTFS extract ``` (cd bsag/ && zip -r ../connect-ls-top-dhid-retain-bsag.gtfs.zip .) mv ../connect-ls-top-dhid-retain-bsag.gtfs.zip ./otp ``` # OSM source file * download osm extract for lower saxony ``` cd mkdir osm && cd osm rm wget-log-niedersachsen rm niedersachsen.osm.pbf wget -o ./wget-log-niedersachsen -O niedersachsen-latest.osm.pbf http://download.geofabrik.de/europe/germany/niedersachsen-latest.osm.pbf ``` * get bounding box as CSV from [here](https://boundingbox.klokantech.com/) ``` 8.415555,52.893073,9.034566,53.269949 ``` * install osmconvert ``` sudo apt update sudo apt install osmctools --no-install-recommends ``` * generate OSM extract for bsag ``` cd ~/osm osmconvert .pbf -b=8.415555,52.893073,9.034566,53.269949 --complete-ways -o=.pbf cd mkdir -p ~/otp mv ~/osm/.pbf ~/otp/ ``` # Prepare otp * build otp on development host and copy on server host or download otp ATTENTION: Otp can be downloaded from here: https://github.com/opentripplanner/OpenTripPlanner/releases/ https://repo1.maven.org/maven2/org/opentripplanner/otp/ ``` cd ~/otp mv ~/connect-ls-top-dhid-retain-bsag.gtfs.zip ~/otp/ sudo update-alternatives --config java ``` # Build street graph * save the graph ``` cd ~/otp java -Xmx2G -jar otp-2.2.0-shaded.jar --buildStreet . ``` # Build a graph layering transit data on top of the saved street graph ``` cd ~/otp java -Xmx2G -jar otp-2.2.0-shaded.jar --loadStreet --save . ``` # Configure otp * configure graph build in file build-config.json like this ``` { "graph":"file:///home/otp/otp-2.3.0/graph-${otp.serialization.version.id}.obj", "configVersion":"v0.0.1", "osmDefaults": { "osmTagMapping": "default", "timeZone": "Europe/Berlin" } } ``` * configure routing in file router-config.json like this ``` { "updaters": [ { "type" : "real-time-alerts", "frequencySec" : 60, "url" : "http://gtfsr.vbn.de/gtfsr_connect.bin", "feedId" : "VBN" }, { "type" : "stop-time-updater", "frequencySec" : 60, "backwardsDelayPropagationType" : "REQUIRED_NO_DATA", "url" : "http://gtfsr.vbn.de/gtfsr_connect.bin", "feedId" : "VBN" } ], "configVersion":"v0.0.1" } ``` * configure otp in general in file otp-config.json like this ``` { "otpFeatures" : { "SandboxAPILegacyGraphQLApi": true } } ``` # Start otp ``` cd ~/otp java -Xmx2G -jar otp-2.2.0-shaded.jar --load . ```