From a71113de19bde7b4f9e36e48b1a02729cf8199ce Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Wed, 7 Aug 2024 13:59:34 +0200 Subject: [PATCH 1/3] Switch to NeTEx transit data --- build-config.json | 4 ++-- build-graph.sh | 15 +++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/build-config.json b/build-config.json index d0b1de36..7d424c6b 100644 --- a/build-config.json +++ b/build-config.json @@ -4,8 +4,8 @@ "staticParkAndRide": false, "transitFeeds": [ { - "source": "https://gtfs.api.opendatahub.com/v1/dataset/sta-time-tables/raw", - "type": "gtfs", + "source": "data/sta-netex.xml.zip", + "type": "netex", "feedId": "sta" }, { diff --git a/build-graph.sh b/build-graph.sh index f5864bef..0fc3263a 100755 --- a/build-graph.sh +++ b/build-graph.sh @@ -6,7 +6,7 @@ source .otp-version -WGET="wget --progress=bar:force:noscroll" +CURL="curl --location --fail --show-error -#" # OSM NORTH_EAST_URL=https://download.geofabrik.de/europe/italy/nord-est-latest.osm.pbf @@ -15,6 +15,9 @@ SOUTH_TYROL_PBF=data/south-tyrol.osm.pbf # elevation ELEVATION_URL=https://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/TIFF/srtm_39_03.zip ELEVATION_ZIP=data/srtm_39_03.zip +# transit data +TRANSIT_NETEX_URL="ftp://ftp01.sta.bz.it/netex/2024/plan/EU_Profil/NX-PI_01_it_apb_LINE_apb__$(date +%Y%m%d).xml.zip" +TRANSIT_NETEX_ZIP=data/sta-netex.xml.zip # parking PARKING_NETEX_URL=https://transmodel.api.opendatahub.com/netex/parking PARKING_NETEX_XML=data/shared-data.xml @@ -28,7 +31,8 @@ fi mkdir -p data if [ ! -f "${NORTH_EAST_PBF}" ]; then - ${WGET} ${NORTH_EAST_URL} -O ${NORTH_EAST_PBF} + echo "Downloading OSM data for NE Italy from ${NORTH_EAST_URL}" + ${CURL} ${NORTH_EAST_URL} -o ${NORTH_EAST_PBF} else echo "Checking for updates for existing OSM file" pyosmium-up-to-date ${NORTH_EAST_PBF} @@ -39,13 +43,16 @@ echo "Extracting ${SOUTH_TYROL_PBF} from ${NORTH_EAST_PBF}" osmium extract ${NORTH_EAST_PBF} --polygon south-tyrol.geojson -o ${SOUTH_TYROL_PBF} --overwrite if [ ! -f "${ELEVATION_ZIP}" ]; then - ${WGET} ${ELEVATION_URL} -O ${ELEVATION_ZIP} + ${CURL} ${ELEVATION_URL} -o ${ELEVATION_ZIP} unzip -o ${ELEVATION_ZIP} -d data fi +echo "Downloading NeTEx transit data from ${TRANSIT_NETEX_URL}" +${CURL} "${TRANSIT_NETEX_URL}" -o ${TRANSIT_NETEX_ZIP} + # 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} +${CURL} ${PARKING_NETEX_URL} -o ${PARKING_NETEX_XML} zip --junk-paths ${PARKING_NETEX_ZIP} ${PARKING_NETEX_XML} From 0614d6a09009af3085d47c7258ef4cdf01ed2429 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Wed, 7 Aug 2024 14:03:51 +0200 Subject: [PATCH 2/3] Harmonise file endings --- build-config.json | 2 +- build-graph.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build-config.json b/build-config.json index 7d424c6b..185a70d0 100644 --- a/build-config.json +++ b/build-config.json @@ -19,7 +19,7 @@ "feedId": "amarillo" }, { - "source": "data/parking-netex.zip", + "source": "data/parking-netex.xml.zip", "type": "netex", "feedId": "parking", "ignoreParking": false diff --git a/build-graph.sh b/build-graph.sh index 0fc3263a..c8368e9e 100755 --- a/build-graph.sh +++ b/build-graph.sh @@ -21,7 +21,7 @@ TRANSIT_NETEX_ZIP=data/sta-netex.xml.zip # parking PARKING_NETEX_URL=https://transmodel.api.opendatahub.com/netex/parking PARKING_NETEX_XML=data/shared-data.xml -PARKING_NETEX_ZIP=data/parking-netex.zip +PARKING_NETEX_ZIP=data/parking-netex.xml.zip # when on github actions then install the required tools if [ -n "${CI+isset}" ]; then From 0f2cbc2918db593f2d8392f0720a56c7f2e23430 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Wed, 7 Aug 2024 14:19:41 +0200 Subject: [PATCH 3/3] Extract correct time --- build-config.json | 4 +++- build-graph.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build-config.json b/build-config.json index 185a70d0..a516f5e5 100644 --- a/build-config.json +++ b/build-config.json @@ -2,11 +2,13 @@ "embedRouterConfig": true, "areaVisibility": true, "staticParkAndRide": false, + "transitModelTimeZone": "Europe/Rome", "transitFeeds": [ { "source": "data/sta-netex.xml.zip", "type": "netex", - "feedId": "sta" + "feedId": "sta", + "groupFilePattern": "(.*)\\.xml" }, { "source": "https://gtfs.api.opendatahub.com/v1/dataset/skyalps-flight-data/raw", diff --git a/build-graph.sh b/build-graph.sh index c8368e9e..574c14dd 100755 --- a/build-graph.sh +++ b/build-graph.sh @@ -16,7 +16,7 @@ SOUTH_TYROL_PBF=data/south-tyrol.osm.pbf ELEVATION_URL=https://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/TIFF/srtm_39_03.zip ELEVATION_ZIP=data/srtm_39_03.zip # transit data -TRANSIT_NETEX_URL="ftp://ftp01.sta.bz.it/netex/2024/plan/EU_Profil/NX-PI_01_it_apb_LINE_apb__$(date +%Y%m%d).xml.zip" +TRANSIT_NETEX_URL="ftp://ftp01.sta.bz.it/netex/$(date +%Y)/plan/EU_Profil/NX-PI_01_it_apb_LINE_apb__$(date +%Y%m%d).xml.zip" TRANSIT_NETEX_ZIP=data/sta-netex.xml.zip # parking PARKING_NETEX_URL=https://transmodel.api.opendatahub.com/netex/parking