Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vector tile configuration, graph build improvements #194

Merged
merged 4 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,8 @@ jobs:
uses: actions/cache@v4
with:
path: |
data/italy-nord-est.osm.pbf
data/srtm*
key: input-data-${{ github.run_number }}
restore-keys: input-data
key: elevation

- name: Build graph
run: bash build-graph.sh
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Build graph

on:
- pull_request
- push

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- run: ./build-graph.sh
2 changes: 1 addition & 1 deletion build-graph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fi

# download parking data and put it into a zip
rm -f ${PARKING_NETEX_XML} ${PARKING_NETEX_ZIP}
wget ${PARKING_NETEX_URL} -O ${PARKING_NETEX_XML}
${WGET} ${PARKING_NETEX_URL} -O ${PARKING_NETEX_XML}

zip --junk-paths ${PARKING_NETEX_ZIP} ${PARKING_NETEX_XML}

Expand Down
2 changes: 1 addition & 1 deletion infrastructure/docker/otp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM opentripplanner/opentripplanner:2.6.0_2024-08-01T06-53

WORKDIR /var/otp

ADD router-config.json /var/otp/
ADD router-config.json otp-config.json /var/otp/
ADD graph.obj /var/otp/

ENTRYPOINT java $JAVA_OPTS -cp @/app/jib-classpath-file @/app/jib-main-class-file /var/otp/ --load --serve
5 changes: 5 additions & 0 deletions otp-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"otpFeatures": {
"SandboxAPIMapboxVectorTilesApi": true
}
}
68 changes: 68 additions & 0 deletions router-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,74 @@
"maxWindow": "16h"
}
},
"vectorTiles": {
"layers": [
{
"name": "stops",
"type": "Stop",
"mapper": "Digitransit",
"maxZoom": 20,
"minZoom": 14,
"cacheMaxSeconds": 600
},
// flex zones
{
"name": "areaStops",
"type": "AreaStop",
"mapper": "OTPRR",
"maxZoom": 20,
"minZoom": 14,
"cacheMaxSeconds": 600
},
{
"name": "stations",
"type": "Station",
"mapper": "Digitransit",
"maxZoom": 20,
"minZoom": 12,
"cacheMaxSeconds": 600
},
// all rental places: stations and free-floating vehicles
{
"name": "citybikes",
"type": "VehicleRental",
"mapper": "Digitransit",
"maxZoom": 20,
"minZoom": 14,
"cacheMaxSeconds": 60,
"expansionFactor": 0.25
},
// just free-floating vehicles
{
"name": "rentalVehicles",
"type": "VehicleRentalVehicle",
"mapper": "DigitransitRealtime",
"maxZoom": 20,
"minZoom": 14,
"cacheMaxSeconds": 60
},
// just rental stations
{
"name": "rentalStations",
"type": "VehicleRentalStation",
"mapper": "Digitransit",
"maxZoom": 20,
"minZoom": 14,
"cacheMaxSeconds": 600
},
// no real-time, translatable fields are translated based on accept-language header
// and contains less fields than the Stadtnavi mapper
{
"name": "vehicleParking",
"type": "VehicleParking",
"mapper": "Digitransit",
"maxZoom": 20,
"minZoom": 14,
"cacheMaxSeconds": 600,
"expansionFactor": 0.25
}
]
},
"updaters": [
{
"type": "stop-time-updater",
Expand Down