-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #176 from noi-techpark/otp2
First draft of migration to OTP2
- Loading branch information
Showing
11 changed files
with
191 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,5 @@ journey/node_modules | |
journey/.env | ||
journey/tmp | ||
geocoder/.env | ||
|
||
graph.obj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,25 @@ | ||
{ | ||
"useTransfersTxt": false, | ||
"embedRouterConfig": true, | ||
"parentStopLinking": true, | ||
"stopClusterMode": "parentStation" | ||
"embedRouterConfig": true, | ||
"areaVisibility": true, | ||
"transitFeeds": [ | ||
{ | ||
"source": "https://gtfs.api.opendatahub.com/v1/dataset/sta-time-tables/raw", | ||
"type": "gtfs", | ||
"feedId": "sta" | ||
} | ||
/* | ||
this feed is not GTFS-compliant yet: https://github.com/noi-techpark/odh-mentor-otp/issues/168#issuecomment-1904328702 | ||
,{ | ||
"source": "https://gtfs.api.opendatahub.com/v1/dataset/skyalps-flight-data/raw", | ||
"type": "gtfs", | ||
"feedId": "skyalps" | ||
}*/ | ||
], | ||
"osm": [ | ||
{ | ||
"source": "data/south-tyrol.osm.pbf", | ||
"timeZone": "Europe/Rome", | ||
"osmTagMapping": "default" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
|
||
# SPDX-FileCopyrightText: NOI Techpark <[email protected]> | ||
# | ||
# SPDX-License-Identifier: CC0-1.0 | ||
|
||
mkdir -p data | ||
|
||
NORTH_EASTH_PBF=data/italy-nord-est.osm.pbf | ||
SOUTH_TYROL_PBF=data/south-tyrol.osm.pbf | ||
|
||
OTP_IMAGE=docker.io/opentripplanner/opentripplanner:2.5.0_2024-01-19T14-50 | ||
|
||
wget -q --show-progress --no-clobber https://download.geofabrik.de/europe/italy/nord-est-latest.osm.pbf -O ${NORTH_EASTH_PBF} | ||
osmium extract ${NORTH_EASTH_PBF} --polygon south-tyrol.geojson -o ${SOUTH_TYROL_PBF} --overwrite | ||
|
||
docker run \ | ||
-v .:/var/opentripplanner/:z \ | ||
--rm \ | ||
-e JAVA_TOOL_OPTIONS="-Xmx6G" \ | ||
${OTP_IMAGE} --build --save |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,8 @@ | ||
FROM node:16.14.0-alpine3.14 | ||
FROM docker.io/opentripplanner/opentripplanner:2.5.0_2024-01-19T14-50 | ||
|
||
ARG OTP_VERSION=1.5.2 | ||
ARG GTFS_URL_UPDATETIME="0 2 * * *" | ||
WORKDIR /var/otp | ||
|
||
ENV JAVA_MX=4G \ | ||
GBFS_VERSION=1 \ | ||
GTFS_URL=ftp://ftp.sta.bz.it/gtfs/google_transit_shp.zip \ | ||
GTFS_URL_UPDATETIME=$GTFS_URL_UPDATETIME \ | ||
GTFS_URL_UPDATEHOOK='' | ||
ADD router-config.json /var/otp/ | ||
ADD graph.obj /var/otp/ | ||
|
||
RUN apk add --no-cache \ | ||
openjdk8-jre \ | ||
unzip \ | ||
bash \ | ||
curl \ | ||
gdal-tools | ||
|
||
RUN mkdir -p /usr/local/share/java | ||
RUN mkdir -p /var/otp | ||
RUN mkdir -p /conf | ||
|
||
# OpenTripPlanner Openmove fork https://github.com/openmove/OpenTripPlanner | ||
|
||
#RUN curl -o /usr/local/share/java/otp.jar https://repo1.maven.org/maven2/org/opentripplanner/otp/$OTP_VERSION/otp-$OTP_VERSION-shaded.jar | ||
#COPY otp-1.5.0-clusters-extended.jar /usr/local/share/java/otp-unofficial.jar | ||
|
||
#RUN curl -Lo otp-unofficial.jar "https://github.com/openmove/OpenTripPlanner/releases/download/v${OTP_VERSION}/otp-${OTP_VERSION}-SNAPSHOT-shaded.jar" | ||
#COPY otp-unofficial.jar /usr/local/share/java/otp-unofficial.jar | ||
|
||
COPY otp-1.5.2-openmove.jar /usr/local/share/java/otp-unofficial.jar | ||
|
||
COPY otp.sh /usr/local/bin/ | ||
COPY otp-unofficial.sh /usr/local/bin/ | ||
|
||
COPY infrastructure/docker/otp/docker-entrypoint.sh /docker-entrypoint.sh | ||
|
||
COPY build-config.json /conf/ | ||
COPY router-config.json /conf/ | ||
COPY envconfig.js /conf/ | ||
|
||
COPY ./gtfs2bbox /gtfs2bbox | ||
COPY ./gtfs-import-task /gtfs-import-task | ||
|
||
RUN chmod 755 /gtfs-import-task/gtfs-download.sh | ||
|
||
RUN cd /gtfs2bbox && \ | ||
npm install | ||
|
||
RUN chmod 755 /usr/local/bin/* | ||
RUN chmod 755 /docker-entrypoint.sh | ||
|
||
ENTRYPOINT ["/bin/bash"] | ||
CMD ["/docker-entrypoint.sh"] | ||
ENTRYPOINT java $JAVA_OPTS -cp @/app/jib-classpath-file @/app/jib-main-class-file /var/otp/ --load --serve |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,18 @@ | ||
{ | ||
"updaters": [ | ||
{ | ||
"type": "stop-time-updater", | ||
"sourceType": "gtfs-http", | ||
"frequencySec": 60, | ||
"feedId": "${GTFS_FEED_ID}", | ||
"url": "${GTFS_RT_URL}" | ||
}, | ||
{ | ||
"type": "bike-rental", | ||
"frequencySec": 120, | ||
"sourceType": "gbfs", | ||
"network": "BZ", | ||
"url": "${GBFS_HOST}/bz/${GBFS_VERSION}/" | ||
}, | ||
{ | ||
"type": "bike-rental", | ||
"frequencySec": 120, | ||
"sourceType": "gbfs", | ||
"network": "ME", | ||
"url": "${GBFS_HOST}/me/${GBFS_VERSION}/" | ||
}, | ||
{ | ||
"type": "bike-rental", | ||
"frequencySec": 120, | ||
"sourceType": "gbfs", | ||
"network": "PAPIN", | ||
"url": "${GBFS_HOST}/papin/${GBFS_VERSION}/" | ||
}, | ||
{ | ||
"type": "car-rental-updater", | ||
"sourceType": "car2go", | ||
"frequencySec": 30, | ||
"vehiclesUrl": "${CARSHARING_HOST}/carsharing/vehicles.json", | ||
"regionsUrl": "${CARSHARING_HOST}/carsharing/regions.json" | ||
}, | ||
{ | ||
"type": "car-park", | ||
"sourceType": "park-and-ride", | ||
"frequencySec": 60, | ||
"url": "${PARKING_HOST}/parking/park-ride.json" | ||
} | ||
] | ||
"routingDefaults" : { | ||
"numItineraries": 5 | ||
}, | ||
"transit": { | ||
"dynamicSearchWindow": { | ||
"minWindow": "4h", | ||
"maxWindow": "16h" | ||
} | ||
}, | ||
"updaters": [ | ||
{ | ||
"type": "stop-time-updater", | ||
"url": "https://mobility.api.opendatahub.testingmachine.eu/v2/GTFS-RT", | ||
"feedId": "sta" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
# SPDX-FileCopyrightText: NOI Techpark <[email protected]> | ||
# | ||
# SPDX-License-Identifier: CC0-1.0 | ||
|
||
OTP_IMAGE=docker.io/opentripplanner/opentripplanner:2.5.0_2024-01-19T14-50 | ||
|
||
docker run \ | ||
-it \ | ||
-v .:/var/opentripplanner/:z \ | ||
--rm \ | ||
-e JAVA_TOOL_OPTIONS="-Xmx6G" \ | ||
-p 8080:8080 \ | ||
${OTP_IMAGE} --load --serve |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": {}, | ||
"geometry": { | ||
"coordinates": [ | ||
[ | ||
[ | ||
10.596094752863905, | ||
46.88761850922589 | ||
], | ||
[ | ||
10.215075147765305, | ||
46.79604829659155 | ||
], | ||
[ | ||
9.926735987150636, | ||
46.62658549503311 | ||
], | ||
[ | ||
9.871814242271313, | ||
46.252843252677394 | ||
], | ||
[ | ||
10.323686680175655, | ||
45.99649468969423 | ||
], | ||
[ | ||
10.506675858631127, | ||
45.75948870782801 | ||
], | ||
[ | ||
10.926745068688348, | ||
45.62536275534609 | ||
], | ||
[ | ||
11.248044114250973, | ||
45.6989096427684 | ||
], | ||
[ | ||
11.692449003300908, | ||
45.85746945760036 | ||
], | ||
[ | ||
12.197257540618523, | ||
45.994619692803894 | ||
], | ||
[ | ||
12.583575395676604, | ||
46.14830668791336 | ||
], | ||
[ | ||
12.824759695748952, | ||
46.54438638737474 | ||
], | ||
[ | ||
12.644400789935446, | ||
46.7129104660751 | ||
], | ||
[ | ||
12.351095121931905, | ||
46.922431853118866 | ||
], | ||
[ | ||
12.243747099237027, | ||
47.14271804055227 | ||
], | ||
[ | ||
11.787210094930145, | ||
47.117029331648155 | ||
], | ||
[ | ||
11.272318736688703, | ||
47.06795279562982 | ||
], | ||
[ | ||
11.001142621347753, | ||
46.960293764622435 | ||
], | ||
[ | ||
11.018305666622382, | ||
46.86180681535134 | ||
], | ||
[ | ||
10.99771001229243, | ||
46.81484465408542 | ||
], | ||
[ | ||
10.596094752863905, | ||
46.88761850922589 | ||
] | ||
] | ||
], | ||
"type": "Polygon" | ||
} | ||
} | ||
] | ||
} |