Skip to content

Commit

Permalink
Merge pull request #194 from leonardehrenfried/vector-tiles
Browse files Browse the repository at this point in the history
Add vector tile configuration, graph build improvements
  • Loading branch information
dulvui authored Aug 5, 2024
2 parents cc4df8a + 6475f13 commit 7228754
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 5 deletions.
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

0 comments on commit 7228754

Please sign in to comment.