From 2241c031060ebf6a2b9a2254bf8f9ed4261ceeb0 Mon Sep 17 00:00:00 2001 From: "Begerad, Stefan" Date: Thu, 9 Mar 2023 15:01:31 +0100 Subject: [PATCH] feat(bsag): adjust readme --- bsag/readme.md | 115 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 104 insertions(+), 11 deletions(-) diff --git a/bsag/readme.md b/bsag/readme.md index 118ecad..7d11853 100644 --- a/bsag/readme.md +++ b/bsag/readme.md @@ -2,11 +2,17 @@ * 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) +* 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@github.com:OneBusAway/onebusaway-gtfs-modules.git +git clone https://github.com/OneBusAway/onebusaway-gtfs-modules.git ``` * build tool @@ -15,28 +21,30 @@ cd onebusaway-gtfs-modules mvn clean package ``` -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) - * 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 +* 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 ``` -zip -r connect-ls-top-dhid-retain-bsag.gtfs.zip bsag/ +(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 @@ -48,12 +56,97 @@ wget -o ./wget-log-niedersachsen -O niedersachsen-latest.osm.pbf http://download 8.415555,52.893073,9.034566,53.269949 ``` -* generate OSM extract for bsag +* install osmconvert ``` +sudo apt update +sudo apt install osmctools --no-install-recommends ``` -* later +* 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 . ``` -mkdir otp && cd otp -mv ../connect-ls-top-dhid-retain-bsag.gtfs.zip . -``` \ No newline at end of file