From 8e84abe8982a454efddb23640bae413ab8ede9cb Mon Sep 17 00:00:00 2001 From: Stefan Begerad Date: Mon, 24 May 2021 14:09:18 -0400 Subject: [PATCH 01/23] doc: added link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 11e4fef..de7eff8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # stadtnavi tutorial -This is a step by step introduction how to setup a stadtnavi instance. It aims developers wanting to get up and running quickly, using docker(-compose) as a deployment tool. For setups closer to production, please consult e.g. the [transportkollektiv digitransit cookbook](https://transportkollektiv.github.io/digitransit-setup/). +This is a step by step introduction how to setup a [stadtnavi](https://herrenberg.stadtnavi.de/) instance. It aims developers wanting to get up and running quickly, using docker(-compose) as a deployment tool. For setups closer to production, please consult e.g. the [transportkollektiv digitransit cookbook](https://transportkollektiv.github.io/digitransit-setup/). ## [Step 1](01-installing-and-running-ui/README.md) Step 1 illustrates, how to start and customize a digitransit-ui frontend, connecting to existining backend services. From 6966d89a4405d0a60c3b31d9383371c68b07ddda Mon Sep 17 00:00:00 2001 From: Stefan Begerad Date: Mon, 24 May 2021 14:11:55 -0400 Subject: [PATCH 02/23] doc: adjusted expression --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index de7eff8..3126ccc 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # stadtnavi tutorial -This is a step by step introduction how to setup a [stadtnavi](https://herrenberg.stadtnavi.de/) instance. It aims developers wanting to get up and running quickly, using docker(-compose) as a deployment tool. For setups closer to production, please consult e.g. the [transportkollektiv digitransit cookbook](https://transportkollektiv.github.io/digitransit-setup/). +This is a step by step introduction how to setup a [stadtnavi](https://herrenberg.stadtnavi.de/) instance. It aims for developers wanting to get up and running quickly, using docker(-compose) as a deployment tool. For setups closer to production, please consult e.g. the [transportkollektiv digitransit cookbook](https://transportkollektiv.github.io/digitransit-setup/). ## [Step 1](01-installing-and-running-ui/README.md) Step 1 illustrates, how to start and customize a digitransit-ui frontend, connecting to existining backend services. From 8efdd5cde6b232086b42893cbb702677f05b38cb Mon Sep 17 00:00:00 2001 From: Stefan Begerad Date: Mon, 24 May 2021 14:13:47 -0400 Subject: [PATCH 03/23] doc: added link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3126ccc..a80c35f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This is a step by step introduction how to setup a [stadtnavi](https://herrenberg.stadtnavi.de/) instance. It aims for developers wanting to get up and running quickly, using docker(-compose) as a deployment tool. For setups closer to production, please consult e.g. the [transportkollektiv digitransit cookbook](https://transportkollektiv.github.io/digitransit-setup/). ## [Step 1](01-installing-and-running-ui/README.md) -Step 1 illustrates, how to start and customize a digitransit-ui frontend, connecting to existining backend services. +Step 1 illustrates, how to start and customize a [digitransit-ui](https://github.com/HSLdevcom/digitransit-ui.git) frontend, connecting to existining backend services. ## [Step 2](02-otp-and-graph-building/README.md) Step 2 shows, how to run an OpenTripPlanner backend service and explains how to customize it for a specific region. From 85d507db0de4c1fabb6c282ee68f9bb90545fe29 Mon Sep 17 00:00:00 2001 From: Stefan Begerad Date: Mon, 24 May 2021 14:16:05 -0400 Subject: [PATCH 04/23] doc: added link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a80c35f..fa926cb 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This is a step by step introduction how to setup a [stadtnavi](https://herrenber Step 1 illustrates, how to start and customize a [digitransit-ui](https://github.com/HSLdevcom/digitransit-ui.git) frontend, connecting to existining backend services. ## [Step 2](02-otp-and-graph-building/README.md) -Step 2 shows, how to run an OpenTripPlanner backend service and explains how to customize it for a specific region. +Step 2 shows, how to run an [OpenTripPlanner](https://github.com/HSLdevcom/digitransit-ui.git) backend service and explains how to customize it for a specific region. ## [Step 3](03-running-otp-and-digitransit/README.md) Step 3 shows, how to run the customized digitransit-ui, the OpenTripPlanner backend service and the map server to display POIs. From aefb73dc78151db472aad729ec9669036c28981f Mon Sep 17 00:00:00 2001 From: Stefan Begerad Date: Mon, 24 May 2021 14:26:50 -0400 Subject: [PATCH 05/23] doc: adjusted expression for consistency reasons --- 01-installing-and-running-ui/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01-installing-and-running-ui/README.md b/01-installing-and-running-ui/README.md index 549600c..98c953b 100644 --- a/01-installing-and-running-ui/README.md +++ b/01-installing-and-running-ui/README.md @@ -1,4 +1,4 @@ -## Customize stadtnavi Frontend, using existing back-end services +## Customize stadtnavi frontend, using existing backend services ### 1. Requirements, installation - docker - git From 9784706bad02c908c8f901b5fb93e6a0498210cd Mon Sep 17 00:00:00 2001 From: Stefan Begerad Date: Mon, 24 May 2021 14:28:04 -0400 Subject: [PATCH 06/23] doc: Listing Docker as requirement once is enough, right? --- 01-installing-and-running-ui/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/01-installing-and-running-ui/README.md b/01-installing-and-running-ui/README.md index 98c953b..6a7ff0d 100644 --- a/01-installing-and-running-ui/README.md +++ b/01-installing-and-running-ui/README.md @@ -1,6 +1,5 @@ ## Customize stadtnavi frontend, using existing backend services ### 1. Requirements, installation - - docker - git - nodejs(v10.24.0) - yarn(LTS) From 23e02ba6c4de836aac4a9d0fbe4d34d20eee9682 Mon Sep 17 00:00:00 2001 From: Stefan Begerad Date: Mon, 24 May 2021 14:36:38 -0400 Subject: [PATCH 07/23] doc: adjusted expression --- 01-installing-and-running-ui/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01-installing-and-running-ui/README.md b/01-installing-and-running-ui/README.md index 6a7ff0d..4bf227d 100644 --- a/01-installing-and-running-ui/README.md +++ b/01-installing-and-running-ui/README.md @@ -102,7 +102,7 @@ $ cd digitransit-ui ``` -### 3. Doing an initial build an see it works +### 3. Doing an initial build to see it works ``` $ yarn install From 83ba07f3da3a5f4e5806917e3be011012e0a7bab Mon Sep 17 00:00:00 2001 From: Stefan Begerad Date: Mon, 24 May 2021 14:46:10 -0400 Subject: [PATCH 08/23] doc: adjusted expression --- 01-installing-and-running-ui/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01-installing-and-running-ui/README.md b/01-installing-and-running-ui/README.md index 4bf227d..ffe3b7f 100644 --- a/01-installing-and-running-ui/README.md +++ b/01-installing-and-running-ui/README.md @@ -102,7 +102,7 @@ $ cd digitransit-ui ``` -### 3. Doing an initial build to see it works +### 3. Doing an initial build to see if it works ``` $ yarn install From f06f7602eaca5171856d875d14e2c8eef0403966 Mon Sep 17 00:00:00 2001 From: Stefan Begerad Date: Mon, 24 May 2021 14:52:58 -0400 Subject: [PATCH 09/23] doc: adjusted expression --- 01-installing-and-running-ui/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01-installing-and-running-ui/README.md b/01-installing-and-running-ui/README.md index ffe3b7f..77d7292 100644 --- a/01-installing-and-running-ui/README.md +++ b/01-installing-and-running-ui/README.md @@ -135,7 +135,7 @@ In the console you will see this message `Digitransit-ui available on port 8080` ### 4. Starting a new config - to add a new theme run: `yarn run add-theme ` - for example `yarn run add-theme rt` - - 3 file should be created and 1 modified: + - 3 files should be created and 1 modified: 1. app/configurations/config..js 2. sass/themes//_theme.scss 3. sass/themes//main.scss From 31d2c01a44d86ed1c35c661c3d1a941d41c5e7c8 Mon Sep 17 00:00:00 2001 From: Stefan Begerad Date: Tue, 25 May 2021 11:51:42 -0400 Subject: [PATCH 10/23] doc: translated heading --- 02-otp-and-graph-building/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/02-otp-and-graph-building/README.md b/02-otp-and-graph-building/README.md index 92a9f6f..7b22765 100644 --- a/02-otp-and-graph-building/README.md +++ b/02-otp-and-graph-building/README.md @@ -1,5 +1,4 @@ -# stadtnavi Tutorial - OpenTripPlanner aufsetzen - +# stadtnavi Tutorial - OpenTripPlanner setup ## Building and running OpenTripPlanner with default config From 3fdf39c072965493e71e92eefff5c1c6a329c895 Mon Sep 17 00:00:00 2001 From: Stefan Begerad Date: Tue, 25 May 2021 13:11:35 -0400 Subject: [PATCH 11/23] doc: adjusted expression --- 02-otp-and-graph-building/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/02-otp-and-graph-building/README.md b/02-otp-and-graph-building/README.md index 7b22765..c6d11b0 100644 --- a/02-otp-and-graph-building/README.md +++ b/02-otp-and-graph-building/README.md @@ -32,7 +32,7 @@ Creating 02-otp-and-graph-building_opentripplanner_1 ... done $ ``` -To verify that the OpenTripPlanner started successfully, you may check for the following lines in the logs: +To verify that OpenTripPlanner started successfully, you may check for the following lines in the logs: ```sh $ docker logs 02-otp-and-graph-building_opentripplanner_1 From 459c7d804c6d8ffbb8aeed81c3c35952da96670e Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 30 Jul 2021 14:32:34 +0200 Subject: [PATCH 12/23] Update chapter one of tutorial to work with OTP2 --- 01-installing-and-running-ui/README.md | 556 ++++++++++++++++++------- 1 file changed, 412 insertions(+), 144 deletions(-) diff --git a/01-installing-and-running-ui/README.md b/01-installing-and-running-ui/README.md index 77d7292..2306e69 100644 --- a/01-installing-and-running-ui/README.md +++ b/01-installing-and-running-ui/README.md @@ -1,6 +1,7 @@ ## Customize stadtnavi frontend, using existing backend services ### 1. Requirements, installation - git + - watchman - nodejs(v10.24.0) - yarn(LTS) - build-essential (for the node dependencies) @@ -44,6 +45,17 @@ $ git --version git version 2.20.1 ``` +### Installing watchman: + +On Mac run + +``` +brew install watchman +``` + +On Debian 10 it is rather difficult to install. Please follow the instructions +on the [Watchman installation page](https://facebook.github.io/watchman/docs/install.html). + ### Installing npm, nodejs and yarn: #### install nodejs version 10(more info [here](https://github.com/nodesource/distributions)): @@ -124,6 +136,24 @@ warning "eslint-config-airbnb > eslint-config-airbnb-base@13.2.0" has incorrect [5/5] Building fresh packages... warning Your current version of Yarn is out of date. The latest version is "1.22.5", while you're on "1.13.0". Done in 339.80s. + +$ yarn setup + +... +lerna success run Ran npm script 'clean' in 2 packages in 1.8s: +lerna success - @digitransit-store/digitransit-store-common-functions +lerna success - @digitransit-store/digitransit-store-future-route +info filter [ '@digitransit-store/*', +info filter '!@digitransit-component/digitransit-component', +info filter '!@digitransit-component/digitransit-component-with-breakpoint', +info filter '!undefined' ] + +/tmp/digitransit-ui/digitransit-store/packages/digitransit-store-common-functions/src/index.js → digitransit-store/packages/digitransit-store-common-functions/lib... +created digitransit-store/packages/digitransit-store-common-functions/lib in 876ms + +/tmp/digitransit-ui/digitransit-store/packages/digitransit-store-future-route/src/index.js → digitransit-store/packages/digitransit-store-future-route/lib... +created digitransit-store/packages/digitransit-store-future-route/lib in 1.8s + ``` The warnings are "ok". @@ -152,185 +182,423 @@ In the console you will see this message `Digitransit-ui available on port 8080` * `config.rt.js` * Replace the content of `config.rt.js` with the following code: ``` - /* eslint-disable */ - import configMerger from '../util/configMerger'; - - const CONFIG = 'rt'; - const APP_TITLE = 'Reutlingen'; - const APP_DESCRIPTION = 'stadtnavi - reutlingen'; - const API_URL = process.env.API_URL || 'https://api.stadtnavi.de'; - const MAP_URL = process.env.MAP_URL || 'https://tiles.stadtnavi.eu/streets/{z}/{x}/{y}{r}.png'; - const SEMI_TRANSPARENT_MAP_URL = process.env.SEMI_TRANSPARENT_MAP_URL || 'https://api.maptiler.com/maps/ffa4d49e-c68c-46c8-ab3f-60543337cecb/256/{z}/{x}/{y}.png?key=eA0drARBA1uPzLR6StGD'; - const GEOCODING_BASE_URL = process.env.GEOCODING_BASE_URL || "https://photon.stadtnavi.eu/pelias/v1"; - const LOCATIONIQ_API_KEY = process.env.LOCATIONIQ_API_KEY; - const YEAR = 1900 + new Date().getYear(); - const STATIC_MESSAGE_URL = + /* eslint-disable */ +import configMerger from '../util/configMerger'; + +const CONFIG = 'rt'; +const APP_TITLE = 'stadtnavi Reutlingen'; +const APP_DESCRIPTION = 'Gemeinsam Mobilität neu denken - die intermodale Verbindungssuche mit offenen, lokalen Daten'; +const API_URL = process.env.API_URL || 'https://api.stadtnavi.de'; +const MAP_URL = process.env.MAP_URL || 'https://tiles.stadtnavi.eu/streets/{z}/{x}/{y}{r}.png'; +const SEMI_TRANSPARENT_MAP_URL = process.env.SEMITRANSPARENT_MAP_URL || "https://tiles.stadtnavi.eu/satellite-overlay/{z}/{x}/{y}{r}.png"; +const GEOCODING_BASE_URL = process.env.GEOCODING_BASE_URL || "https://photon.stadtnavi.eu/pelias/v1"; +const YEAR = 1900 + new Date().getYear(); +const STATIC_MESSAGE_URL = process.env.STATIC_MESSAGE_URL || '/assets/messages/message.hb.json'; - const walttiConfig = require('./config.waltti.js').default; +const walttiConfig = require('./config.waltti.js').default; + +const realtimeHbg = require('./realtimeUtils').default.hbg; +const hostname = new URL(API_URL); +realtimeHbg.mqtt = `wss://${hostname.host}/mqtt/`; - const minLat = 48.395; - const maxLat = 48.6075; - const minLon = 9.0901; - const maxLon = 9.3616; +const minLat = 47.6020; +const maxLat = 49.0050; +const minLon = 8.4087; +const maxLon = 9.9014; - export default configMerger(walttiConfig, { - CONFIG, - URL: { +export default configMerger(walttiConfig, { + CONFIG, + URL: { OTP: process.env.OTP_URL || `${API_URL}/routing/v1/router/`, MAP: { - default: MAP_URL, - satellite: `${API_URL}/tiles/orthophoto/{z}/{x}/{y}.jpg`, - semiTransparent: SEMI_TRANSPARENT_MAP_URL, - bicycle: 'https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png', + default: MAP_URL, + satellite: 'https://tiles.stadtnavi.eu/orthophoto/{z}/{x}/{y}.jpg', + semiTransparent: SEMI_TRANSPARENT_MAP_URL, + bicycle: 'https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png', }, - STOP_MAP: `${API_URL}/map/v1/stop-map/`, - GEOCODING_BASE_URL: GEOCODING_BASE_URL, - CITYBIKE_MAP: `${API_URL}/map/v1/regiorad-map/` - }, + STOP_MAP: `${API_URL}/routing/v1/router/vectorTiles/stops/`, + DYNAMICPARKINGLOTS_MAP: `${API_URL}/routing/v1/router/vectorTiles/parking/`, + ROADWORKS_MAP: `${API_URL}/map/v1/cifs/`, + COVID19_MAP: `https://tiles.caresteouvert.fr/public.poi_osm_light/{z}/{x}/{y}.pbf`, + CITYBIKE_MAP: `${API_URL}/routing/v1/router/vectorTiles/citybikes/`, + BIKE_PARKS_MAP: `${API_URL}/routing/v1/router/vectorTiles/parking/`, + WEATHER_STATIONS_MAP: `${API_URL}/map/v1/weather-stations/`, + CHARGING_STATIONS_MAP: `${API_URL}/tiles/charging-stations/`, + PELIAS: `${process.env.GEOCODING_BASE_URL || GEOCODING_BASE_URL}/search`, + PELIAS_REVERSE_GEOCODER: `${ + process.env.GEOCODING_BASE_URL || GEOCODING_BASE_URL + }/reverse`, + PELIAS_PLACE: `${ + process.env.GEOCODING_BASE_URL || GEOCODING_BASE_URL + }/place`, + FARES: `${API_URL}/fares`, + FONT: '' // Do not use Google fonts. + }, + + mainMenu: { + showDisruptions: false, + }, - appBarLink: false, + availableLanguages: ['de', 'en'], + defaultLanguage: 'de', - availableLanguages: ['de', 'en'], - defaultLanguage: 'de', + MATOMO_URL: process.env.MATOMO_URL, - mainMenu: { - showDisruptions: false, - }, + /* disable the "next" column of the Route panel as it can be confusing sometimes: https://github.com/stadtnavi/digitransit-ui/issues/167 */ + displayNextDeparture: false, + maxWalkDistance: 15000, + + optimize: "TRIANGLE", + + defaultSettings: { + optimize: "TRIANGLE", + safetyFactor: 0.4, + slopeFactor: 0.3, + timeFactor: 0.3, + }, + + defaultOptions: { + walkSpeed: [0.83, 1.38, 1.94], + }, + + itinerary: { + delayThreshold: 60, + }, - logo: 'hb/stadtnavi-logo.svg', + appBarLink: { + name: 'Feedback', + href: 'https://stadtnavi.de/feedback', + target: '_blank' + }, - colors: { - primary: '#ff5300', - }, + contactName: { + de: 'transportkollektiv', + default: 'transportkollektiv', + }, - socialMedia: { + sprites: 'assets/svg-sprite.hb.svg', + + socialMedia: { title: APP_TITLE, description: APP_DESCRIPTION, - }, - title: APP_TITLE, + image: { + url: '/img/stadtnavi-social-media-card.png', + width: 600, + height: 300, + }, + + twitter: { + card: 'summary_large_image', + site: '@TUGHerrenberg', + }, + }, + + dynamicParkingLots: { + showDynamicParkingLots: true, + dynamicParkingLotsSmallIconZoom: 14, + dynamicParkingLotsMinZoom: 14 + }, + + bikeParks: { + show: true, + smallIconZoom: 14, + minZoom: 14 + }, + + roadworks: { + showRoadworks: true, + roadworksSmallIconZoom: 16, + roadworksMinZoom: 10 + }, + + covid19: { + show: false, + smallIconZoom: 17, + minZoom: 15 + }, + + + weatherStations: { + show: true, + smallIconZoom: 17, + minZoom: 15 + }, + + chargingStations: { + show: true, + smallIconZoom: 14, + minZoom: 14 + }, + + cityBike: { + minZoomStopsNearYou: 10, + showStationId: false, + useSpacesAvailable: false, + showCityBikes: true, + networks: { + regiorad: { + icon: 'regiorad', + name: { + de: 'RegioRad', + en: 'RegioRad', + }, + type: 'citybike', + url: { + de: 'https://www.regioradstuttgart.de/de', + en: 'https://www.regioradstuttgart.de/', + }, + visibleInSettingsUi: true, + } + } + }, + + mergeStopsByCode: true, + + title: APP_TITLE, + + favicon: './app/configurations/images/hbnext/favicon.png', + + meta: { + description: APP_DESCRIPTION, + }, + + modeToOTP: { + carpool: 'CARPOOL', + }, - textLogo: false, + logo: 'hbnext/stadtnavi-logo.svg', - feedIds: ['Reutlingen'], + GTMid: '', - searchParams: { - 'boundary.rect.min_lat': minLat, - 'boundary.rect.max_lat': maxLat, - 'boundary.rect.min_lon': minLon, - 'boundary.rect.max_lon': maxLon, - }, - - map: { + // get newest version from: https://github.com/moment/moment-timezone/blame/develop/data/packed/latest.json + timezoneData: 'Europe/Berlin|CET CEST CEMT|-10 -20 -30|01010101010101210101210101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2aFe0 11d0 1iO0 11A0 1o00 11A0 Qrc0 6i00 WM0 1fA0 1cM0 1cM0 1cM0 kL0 Nc0 m10 WM0 1ao0 1cp0 dX0 jz0 Dd0 1io0 17c0 1fA0 1a00 1ehA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|41e5', + + map: { useRetinaTiles: true, tileSize: 256, - zoomOffset: 0 - }, + zoomOffset: 0, + + showZoomControl: true, // DT-3470, DT-3397 + showStreetModeSelector: false, // DT-3470 + showLayerSelector: true, // DT-3470 + showStopMarkerPopupOnMobile: false, // DT-3470 + showScaleBar: true, // DT-3470, DT-3397 + genericMarker: { + popup: { + offset: [0,0], + maxWidth: 250, + minWidth: 250, + } + }, + attribution: { + 'default': '© OpenStreetMap Mitwirkende, Datensätze der NVBW GmbH und VVS GmbH', + 'satellite': '© OpenStreetMap Mitwirkende, © LGL BW, Datensätze der NVBW GmbH und VVS GmbH', + 'bicycle': '© OpenStreetMap Mitwirkende, © CyclOSM, © OSM-FR, Datensätze der NVBW GmbH und VVS GmbH', + }, + }, + + feedIds: ['hbg'], + + realtime: { hbg: realtimeHbg }, + + searchSources: ['oa', 'osm'], - areaPolygon: [ + searchParams: { + 'boundary.rect.min_lat': 48.34164, + 'boundary.rect.max_lat': 48.97661, + 'boundary.rect.min_lon': 9.95635, + 'boundary.rect.max_lon': 8.530883, + 'focus.point.lat': 48.5957, + 'focus.point.lon': 8.8675 + }, + + areaPolygon: [ [minLon, minLat], [minLon, maxLat], [maxLon, maxLat], [maxLon, minLat], - ], - - defaultEndpoint: { - address: 'Reutlingen', - lat: 0.5 * (minLat + maxLat), - lon: 0.5 * (minLon + maxLon), - }, - - defaultOrigins: [ - { - icon: 'icon-icon_bus', - label: 'ZOB Herrenberg', - lat: 48.5942066, - lon: 8.8644041, - }, - { - icon: 'icon-icon_star', - label: 'Krankenhaus', - lat: 48.59174, - lon: 8.87536, - }, - { - icon: 'icon-icon_star', - label: 'Waldfriedhof / Schönbuchturm', - lat: 48.6020352, - lon: 8.9036348, - }, - ], + ], + + nationalServiceLink: { name: 'Fahrplanauskunft efa-bw', href: 'https://www.efa-bw.de' }, + + defaultEndpoint: { + lat: 48.4929, + lon: 9.208, + }, - footer: { + + menu: { + copyright: { + label: `© Stadt Herrenberg ${YEAR}` + }, content: [ - { label: `© Reutlingen ${walttiConfig.YEAR}` }, - {}, - { - name: 'about-this-service', - nameEn: 'About this service', - route: '/dieser-dienst', - icon: 'icon-icon_info', - }, + { + name: 'about-this-service', + nameEn: 'About this service', + route: '/dieser-dienst', + icon: 'icon-icon_info', + }, + { + name: 'imprint', + nameEn: 'Imprint', + href: 'https://www.herrenberg.de/impressum', + }, + { + name: 'privacy', + nameEn: 'Privacy', + href: 'https://www.herrenberg.de/datenschutz', + }, ], - }, + }, - aboutThisService: { + aboutThisService: { de: [ - { - header: 'Über diesen Dienst', - paragraphs: [ - 'Stadtnavi ist eine Reiseplannungs-Anwendung für die Region Herrenberg. Dieser Dienst umfasst ÖPNV, Fußwege, Radverkehr, PKW-Routing (inklusive Park & Ride) und Fahrgemeinschaften.', - 'Gefördert durch
', - '', - 'Zur Infoseite' - ], - }, - { - header: 'Digitransit Plattform', - paragraphs: [ - 'Dieser Dienst basiert auf der Digitransit Platform und dem Backend-Dienst OpenTripPlanner. Alle Software ist unter einer offenen Lizenzen verfügbar. Vielen Dank an alle Beteiligten.', ], - }, - { - header: 'Datenquellen', - paragraphs: [ - 'Kartendaten: © OpenStreetMap Mitwirkende', - 'ÖPNV-Daten: Datensätze der NVBW GmbH und der VVS GmbH, Shapes (d.h. Geometrien der Streckenverläufe) jeweils angereichert mit OpenStreetMap-Daten © OpenStreetMap Mitwirkende', - 'Alle Angaben ohne Gewähr.' - ], - }, + { + header: 'Über diesen Dienst', + paragraphs: [ + 'stadtnavi ist eine Reiseplanungs-Anwendung für die Stadt Herrenberg und Umgebung. Dieser Dienst umfasst ÖPNV, Fußwege, Radverkehr, Straßen- und Parkplatzinformationen, Ladeinfrastruktur und Sharing-Angebote. Mobilitätsangebote werden durch intermodales Routing miteinander vernetzt.', + 'Gefördert durch
', + '', + + ], + }, + { + header: 'Mitmachen', + paragraphs: [ + 'Die Stadt Herrenberg hat diese App im Rahmen der Modellstadt, gefördert durch das Bundesministerium für Verkehr und digitale Infrastruktur (BMVI) entwickelt. stadtnavi Anwendung ist eine Open Source Lösung und kann von anderen Kommunen und Akteuren unter ihrem Namen und Erscheinungsbild verwendet und an individuelle Bedürfnisse angepasst und weiterentwickelt werden (White Label Lösung). Mitmachen ist gewünscht!', + ] + }, + { + header: 'Digitransit Plattform', + paragraphs: [ + 'Dieser Dienst basiert auf der Digitransit Platform und dem Backend-Dienst OpenTripPlanner. Alle Software ist unter einer offenen Lizenzen verfügbar. Vielen Dank an alle Beteiligten.', + 'Der gesamte Quellcode der Plattform, die aus vielen verschiedenen Komponenten besteht, ist auf Github verfügbar.' + ], + }, + { + header: 'Datenquellen', + paragraphs: [ + 'Kartendaten: © OpenStreetMap Mitwirkende', + 'ÖPNV-Daten: Datensätze der NVBW GmbH und der VVS GmbH, Shapes (d.h. Geometrien der Streckenverläufe) jeweils angereichert mit OpenStreetMap-Daten © OpenStreetMap Mitwirkende', + 'Alle Angaben ohne Gewähr.' + ], + }, ], - fi: [ - { - header: 'Tietoja palvelusta', - paragraphs: [ - 'Tämän palvelun tarjoaa Reutlingen reittisuunnittelua varten Reutlingen alueella. Palvelu kattaa joukkoliikenteen, kävelyn, pyöräilyn ja yksityisautoilun rajatuilta osin. Palvelu perustuu Digitransit-palvelualustaan.', - ], - }, + en: [ + { + header: 'About this service', + paragraphs: [ + 'stadtnavi is a travel planning application for the city of Herrenberg and its surroundings. This service includes public transport, footpaths, cycling, street and parking information, charging infrastructure and sharing offerings. The mobility offerings are connected through intermodal routing.', + '', + ], + }, + { + header: 'Contribute', + paragraphs: [ + 'The city of Herrenberg has developed this app, funded by the Federal Ministry of Transport and Digital Infrastructure (BMVI), as model city. The stadtnavi app is an open source solution and can be used, customized and further developed by other municipalities to meet individual needs (white lable solution). Participation is welcome!', + ] + }, + { + header: 'Digitransit platform', + paragraphs: [ + 'The Digitransit service platform is an open source routing platform developed by HSL and Traficom. It builds on OpenTripPlanner by Conveyal. Enhancements by Transportkollektiv and MITFAHR|DE|ZENTRALE. All software is open source. Thanks to everybody working on this!', + ], + }, + { + header: 'Data sources', + paragraphs: [ + 'Map data: © OpenStreetMap contributors', + 'Public transit data: Datasets by NVBW GmbH and VVS GmbH, Shapes (d.h. Geometrien der Streckenverläufe) enhanced with OpenStreetMap data © OpenStreetMap contributors', + 'No responsibility is accepted for the accuracy of this information.' + ], + }, ], - - sv: [ - { - header: 'Om tjänsten', - paragraphs: [ - 'Den här tjänsten erbjuds av Reutlingen för reseplanering inom Reutlingen region. Reseplaneraren täcker med vissa begränsningar kollektivtrafik, promenad, cykling samt privatbilism. Tjänsten baserar sig på Digitransit-plattformen.', - ], - }, + }, + + redirectReittiopasParams: true, + + showTicketInformation: true, + showTicketPrice: true, + availableTickets: { 'hbg' : {}}, + fareMapping: function mapHbFareId(fareId) { + return { + en: "Adult", + de: "Regulär", + }; + }, + displayFareInfoTop: false, + + + showRouteSearch: false, + showNearYouButtons: false, + + // adding assets/geoJson/hb-layers layers + geoJson: { + layers: [ + // bicycleinfrastructure includes shops, repair stations, + { + name: { + fi: '', + en: 'Service stations and stores', + de: "Service Stationen und Läden", + }, + url: '/assets/geojson/hb-layers/bicycleinfrastructure.geojson', + }, + /* Charging stations + { + name: { + fi: '', + en: 'Charging stations', + de: 'Ladestationen', + }, + url: '/assets/geojson/hb-layers/charging.geojson', + },*/ + // LoRaWan map layer + { + name: { + fi: '', + en: 'LoRaWAN Gateways', + de: 'LoRaWAN Gateways', + }, + url: '/assets/geojson/hb-layers/lorawan-gateways.geojson', + isOffByDefault: true, + }, + // Nette Toilette layer + { + name: { + fi: '', + en: 'Public Toilets', + de: 'Nette Toilette', + }, + url: '/assets/geojson/hb-layers/toilet.geojson', + isOffByDefault: true, + }, ], + }, + staticMessagesUrl: STATIC_MESSAGE_URL, + + + suggestCarMinDistance: 800, + suggestWalkMaxDistance: 3000, + suggestBikeAndPublicMinDistance: 3000, + suggestBikeAndParkMinDistance: 3000, + + // live bus locations + vehicles: true, + showVehiclesOnSummaryPage: false, + showVehiclesOnStopPage: true, + + showBikeAndPublicItineraries: true, + showBikeAndParkItineraries: true, + showStopAndRouteSearch: false, + showTimeTableOptions: false, + + viaPointsEnabled: false, +}); - en: [ - { - header: 'About this service', - paragraphs: [ - 'This service is provided by Reutlingen for route planning in Reutlingen region. The service covers public transport, walking, cycling, and some private car use. Service is built on Digitransit platform.', - ], - }, - ], - }, - // geojson config: - - }); ``` ### 6. Show results @@ -363,4 +631,4 @@ Running stadtnavi instance in dev/prod mode: - more information [here](https://github.com/HSLdevcom/digitransit-ui/blob/master/docs/Docker.md) ### More information -visit: https://github.com/HSLdevcom/digitransit-ui \ No newline at end of file +visit: https://github.com/HSLdevcom/digitransit-ui From 3d963910de082853562ce0a2e7cf8a5d175c8a89 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 30 Jul 2021 14:36:06 +0200 Subject: [PATCH 13/23] Remove Covid-19 map --- 01-installing-and-running-ui/README.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/01-installing-and-running-ui/README.md b/01-installing-and-running-ui/README.md index 2306e69..abbd6ae 100644 --- a/01-installing-and-running-ui/README.md +++ b/01-installing-and-running-ui/README.md @@ -221,7 +221,6 @@ export default configMerger(walttiConfig, { STOP_MAP: `${API_URL}/routing/v1/router/vectorTiles/stops/`, DYNAMICPARKINGLOTS_MAP: `${API_URL}/routing/v1/router/vectorTiles/parking/`, ROADWORKS_MAP: `${API_URL}/map/v1/cifs/`, - COVID19_MAP: `https://tiles.caresteouvert.fr/public.poi_osm_light/{z}/{x}/{y}.pbf`, CITYBIKE_MAP: `${API_URL}/routing/v1/router/vectorTiles/citybikes/`, BIKE_PARKS_MAP: `${API_URL}/routing/v1/router/vectorTiles/parking/`, WEATHER_STATIONS_MAP: `${API_URL}/map/v1/weather-stations/`, @@ -314,13 +313,6 @@ export default configMerger(walttiConfig, { roadworksMinZoom: 10 }, - covid19: { - show: false, - smallIconZoom: 17, - minZoom: 15 - }, - - weatherStations: { show: true, smallIconZoom: 17, From 45e284320edff91045ede431dbc644cc71dc4987 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 30 Jul 2021 14:43:29 +0200 Subject: [PATCH 14/23] Remove more config items --- 01-installing-and-running-ui/README.md | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/01-installing-and-running-ui/README.md b/01-installing-and-running-ui/README.md index abbd6ae..db4d359 100644 --- a/01-installing-and-running-ui/README.md +++ b/01-installing-and-running-ui/README.md @@ -243,8 +243,6 @@ export default configMerger(walttiConfig, { availableLanguages: ['de', 'en'], defaultLanguage: 'de', - MATOMO_URL: process.env.MATOMO_URL, - /* disable the "next" column of the Route panel as it can be confusing sometimes: https://github.com/stadtnavi/digitransit-ui/issues/167 */ displayNextDeparture: false, maxWalkDistance: 15000, @@ -279,22 +277,6 @@ export default configMerger(walttiConfig, { sprites: 'assets/svg-sprite.hb.svg', - socialMedia: { - title: APP_TITLE, - description: APP_DESCRIPTION, - - image: { - url: '/img/stadtnavi-social-media-card.png', - width: 600, - height: 300, - }, - - twitter: { - card: 'summary_large_image', - site: '@TUGHerrenberg', - }, - }, - dynamicParkingLots: { showDynamicParkingLots: true, dynamicParkingLotsSmallIconZoom: 14, @@ -523,7 +505,6 @@ export default configMerger(walttiConfig, { }, displayFareInfoTop: false, - showRouteSearch: false, showNearYouButtons: false, From ccc33d066ab41610051667330428f665f2dcf3ec Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 6 Aug 2021 14:59:22 +0200 Subject: [PATCH 15/23] Migrate chapter 2 to OTP2 --- 02-otp-and-graph-building/Dockerfile | 31 +++++--------------- 02-otp-and-graph-building/README.md | 2 +- 02-otp-and-graph-building/docker-compose.yml | 17 ++++------- 3 files changed, 14 insertions(+), 36 deletions(-) diff --git a/02-otp-and-graph-building/Dockerfile b/02-otp-and-graph-building/Dockerfile index fcce8ab..378c67d 100644 --- a/02-otp-and-graph-building/Dockerfile +++ b/02-otp-and-graph-building/Dockerfile @@ -4,8 +4,6 @@ ARG OTP_IMAGE=mfdz/opentripplanner FROM $OTP_IMAGE:$OTP_TAG AS otp # defined empty, so we can access the arg as env later again -ARG OTP_VERSION -ENV ROUTER_NAME=default ARG gtfs_url=https://www.openvvs.de/dataset/e66f03e4-79f2-41d0-90f1-166ca609e491/resource/bfbb59c7-767c-4bca-bbb2-d8d32a3e0378/download/google_transit.zip ENV GTFS_URL=$gtfs_url ARG osm_pbf_url=https://download.geofabrik.de/europe/germany/baden-wuerttemberg/stuttgart-regbez-latest.osm.pbf @@ -16,33 +14,20 @@ ENV MEMORY=$memory RUN apk add --update zip && \ rm -rf /var/cache/apk/* -RUN mkdir -p /opt/opentripplanner/build/$ROUTER_NAME/ +RUN mkdir -p /opt/opentripplanner/build/ # add build data # NOTE: we're using dockers caching here. Add items in order of least to most frequent changes -ADD router-config.json /opt/opentripplanner/build/$ROUTER_NAME/ -ADD build-config.json /opt/opentripplanner/build/$ROUTER_NAME/ -ADD $OSM_PBF_URL /opt/opentripplanner/build/$ROUTER_NAME/ -ADD $GTFS_URL /opt/opentripplanner/build/$ROUTER_NAME/ +ADD router-config.json /opt/opentripplanner/build/ +ADD build-config.json /opt/opentripplanner/build/ +ADD $OSM_PBF_URL /opt/opentripplanner/build/ +ADD $GTFS_URL /opt/opentripplanner/build/gtfs.zip # print version RUN java -jar otp-shaded.jar --version | tee build/version.txt -RUN echo "image: mfdz/opentripplanner:$OTP_VERSION" >> build/version.txt # build -RUN java -Xmx$MEMORY -jar otp-shaded.jar --build build/$ROUTER_NAME | tee build/build.log +RUN java -Xmx$MEMORY -jar otp-shaded.jar --build --save /opt/opentripplanner/build/ | tee build/build.log -# package: graph and config into zip -RUN sh -c 'cd /opt/opentripplanner/build/; export VERSION=$(grep "version:" version.txt | cut -d" " -f2); zip graph-$ROUTER_NAME-$VERSION.zip $ROUTER_NAME/Graph.obj $ROUTER_NAME/router-*.json' - -RUN rm -rf /opt/opentripplanner/build/$ROUTER_NAME - -# --- - -FROM nginx:alpine - -RUN sed -i 'N; s/index index.html index.htm;/autoindex on;/' /etc/nginx/conf.d/default.conf; \ - sed -i '/error_page/d' /etc/nginx/conf.d/default.conf -RUN rm /usr/share/nginx/html/*.html - -COPY --from=otp /opt/opentripplanner/build/ /usr/share/nginx/html/ \ No newline at end of file +# +ENTRYPOINT java -Xmx$MEMORY -jar otp-shaded.jar --load --serve /opt/opentripplanner/build/ diff --git a/02-otp-and-graph-building/README.md b/02-otp-and-graph-building/README.md index c6d11b0..3a3c988 100644 --- a/02-otp-and-graph-building/README.md +++ b/02-otp-and-graph-building/README.md @@ -43,7 +43,7 @@ $ docker logs 02-otp-and-graph-building_opentripplanner_1 12:14:53.865 INFO (GrizzlyServer.java:154) Grizzly server running. ``` -Now OpenTripPlanner is ready and you may access the interal OTP front end via http://localhost:8090 (Note the port is 8090 as 8080 is mapped to 8090 in the docker-compose.yml). +Now OpenTripPlanner is ready and you may access the internal OTP front end via http://localhost:8090 (Note the port is 8090 as 8080 is mapped to 8090 in the docker-compose.yml). If that worked, you may adapt the config to supply your proper data. diff --git a/02-otp-and-graph-building/docker-compose.yml b/02-otp-and-graph-building/docker-compose.yml index cff4761..5785037 100644 --- a/02-otp-and-graph-building/docker-compose.yml +++ b/02-otp-and-graph-building/docker-compose.yml @@ -1,17 +1,8 @@ version: '3' services: - opentripplanner: - image: ${OTP_IMAGE}:${OTP_TAG} - depends_on: - - "graph" - environment: - - ROUTER_NAME=default - - ROUTER_DATA_CONTAINER_URL=http://graph/ - ports: - - "${OTP_PORT}:8080" - graph: - build: + opentripplanner-with-graph: + build: context: . args: - OTP_IMAGE=${OTP_IMAGE} @@ -19,8 +10,10 @@ services: - gtfs_url=${GTFS_URL} - osm_pbf_url=${OSM_URL} - memory=${GRAPH_BUILD_MEMORY} + ports: + - "${OTP_PORT}:8080" healthcheck: test: ["CMD", "curl", "-f", "http://localhost"] interval: 15s timeout: 10s - retries: 3 + retries: 3 From 6cbb50aef3e5a861a1990ad6f2062d29cbdc6f95 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 6 Aug 2021 15:06:48 +0200 Subject: [PATCH 16/23] Use Dockerfile from chapter 2 for chapter 3 --- 03-running-otp-and-digitransit/Dockerfile | 31 ++++++----------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/03-running-otp-and-digitransit/Dockerfile b/03-running-otp-and-digitransit/Dockerfile index fcce8ab..378c67d 100644 --- a/03-running-otp-and-digitransit/Dockerfile +++ b/03-running-otp-and-digitransit/Dockerfile @@ -4,8 +4,6 @@ ARG OTP_IMAGE=mfdz/opentripplanner FROM $OTP_IMAGE:$OTP_TAG AS otp # defined empty, so we can access the arg as env later again -ARG OTP_VERSION -ENV ROUTER_NAME=default ARG gtfs_url=https://www.openvvs.de/dataset/e66f03e4-79f2-41d0-90f1-166ca609e491/resource/bfbb59c7-767c-4bca-bbb2-d8d32a3e0378/download/google_transit.zip ENV GTFS_URL=$gtfs_url ARG osm_pbf_url=https://download.geofabrik.de/europe/germany/baden-wuerttemberg/stuttgart-regbez-latest.osm.pbf @@ -16,33 +14,20 @@ ENV MEMORY=$memory RUN apk add --update zip && \ rm -rf /var/cache/apk/* -RUN mkdir -p /opt/opentripplanner/build/$ROUTER_NAME/ +RUN mkdir -p /opt/opentripplanner/build/ # add build data # NOTE: we're using dockers caching here. Add items in order of least to most frequent changes -ADD router-config.json /opt/opentripplanner/build/$ROUTER_NAME/ -ADD build-config.json /opt/opentripplanner/build/$ROUTER_NAME/ -ADD $OSM_PBF_URL /opt/opentripplanner/build/$ROUTER_NAME/ -ADD $GTFS_URL /opt/opentripplanner/build/$ROUTER_NAME/ +ADD router-config.json /opt/opentripplanner/build/ +ADD build-config.json /opt/opentripplanner/build/ +ADD $OSM_PBF_URL /opt/opentripplanner/build/ +ADD $GTFS_URL /opt/opentripplanner/build/gtfs.zip # print version RUN java -jar otp-shaded.jar --version | tee build/version.txt -RUN echo "image: mfdz/opentripplanner:$OTP_VERSION" >> build/version.txt # build -RUN java -Xmx$MEMORY -jar otp-shaded.jar --build build/$ROUTER_NAME | tee build/build.log +RUN java -Xmx$MEMORY -jar otp-shaded.jar --build --save /opt/opentripplanner/build/ | tee build/build.log -# package: graph and config into zip -RUN sh -c 'cd /opt/opentripplanner/build/; export VERSION=$(grep "version:" version.txt | cut -d" " -f2); zip graph-$ROUTER_NAME-$VERSION.zip $ROUTER_NAME/Graph.obj $ROUTER_NAME/router-*.json' - -RUN rm -rf /opt/opentripplanner/build/$ROUTER_NAME - -# --- - -FROM nginx:alpine - -RUN sed -i 'N; s/index index.html index.htm;/autoindex on;/' /etc/nginx/conf.d/default.conf; \ - sed -i '/error_page/d' /etc/nginx/conf.d/default.conf -RUN rm /usr/share/nginx/html/*.html - -COPY --from=otp /opt/opentripplanner/build/ /usr/share/nginx/html/ \ No newline at end of file +# +ENTRYPOINT java -Xmx$MEMORY -jar otp-shaded.jar --load --serve /opt/opentripplanner/build/ From 28a670f8c7cb8712939b01fe883c5dbf660ee18e Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 6 Aug 2021 23:05:02 +0200 Subject: [PATCH 17/23] Add otp-config to enable GraphQL API --- 02-otp-and-graph-building/Dockerfile | 1 + 02-otp-and-graph-building/otp-config.json | 6 +++++ 03-running-otp-and-digitransit/Dockerfile | 1 + .../docker-compose.yml | 24 +------------------ .../otp-config.json | 6 +++++ 5 files changed, 15 insertions(+), 23 deletions(-) create mode 100644 02-otp-and-graph-building/otp-config.json create mode 100644 03-running-otp-and-digitransit/otp-config.json diff --git a/02-otp-and-graph-building/Dockerfile b/02-otp-and-graph-building/Dockerfile index 378c67d..a8250b6 100644 --- a/02-otp-and-graph-building/Dockerfile +++ b/02-otp-and-graph-building/Dockerfile @@ -20,6 +20,7 @@ RUN mkdir -p /opt/opentripplanner/build/ # NOTE: we're using dockers caching here. Add items in order of least to most frequent changes ADD router-config.json /opt/opentripplanner/build/ ADD build-config.json /opt/opentripplanner/build/ +ADD otp-config.json /opt/opentripplanner/build/ ADD $OSM_PBF_URL /opt/opentripplanner/build/ ADD $GTFS_URL /opt/opentripplanner/build/gtfs.zip diff --git a/02-otp-and-graph-building/otp-config.json b/02-otp-and-graph-building/otp-config.json new file mode 100644 index 0000000..7a16e4f --- /dev/null +++ b/02-otp-and-graph-building/otp-config.json @@ -0,0 +1,6 @@ +{ + "otpFeatures" : { + "SandboxAPILegacyGraphQLApi": true, + "SandboxAPIMapboxVectorTilesApi": true + } +} diff --git a/03-running-otp-and-digitransit/Dockerfile b/03-running-otp-and-digitransit/Dockerfile index 378c67d..a8250b6 100644 --- a/03-running-otp-and-digitransit/Dockerfile +++ b/03-running-otp-and-digitransit/Dockerfile @@ -20,6 +20,7 @@ RUN mkdir -p /opt/opentripplanner/build/ # NOTE: we're using dockers caching here. Add items in order of least to most frequent changes ADD router-config.json /opt/opentripplanner/build/ ADD build-config.json /opt/opentripplanner/build/ +ADD otp-config.json /opt/opentripplanner/build/ ADD $OSM_PBF_URL /opt/opentripplanner/build/ ADD $GTFS_URL /opt/opentripplanner/build/gtfs.zip diff --git a/03-running-otp-and-digitransit/docker-compose.yml b/03-running-otp-and-digitransit/docker-compose.yml index 962a0dc..a150fdf 100644 --- a/03-running-otp-and-digitransit/docker-compose.yml +++ b/03-running-otp-and-digitransit/docker-compose.yml @@ -5,8 +5,6 @@ services: image: stadtnavi/digitransit-proxy:minimal ports: - 8080:8080 - volumes: - - ${PWD}/logs:/var/log/nginx depends_on: - "opentripplanner" digitransit-ui: @@ -21,34 +19,14 @@ services: image: stadtnavi/hsl-map-server:latest environment: - OTP_URL=opentripplanner:8080/otp/routers/default/index/graphql - # - PARK_API_URL=https://api.parkendd.de/Freiburg depends_on: - "opentripplanner" opentripplanner: image: ${OTP_IMAGE}:${OTP_TAG} - depends_on: - - "graph" - environment: - - ROUTER_NAME=default - - ROUTER_DATA_CONTAINER_URL=http://graph/ ports: - "${OTP_PORT}:8080" healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/"] interval: 15s timeout: 10s - retries: 30 - graph: - build: - context: . - args: - - OTP_IMAGE=${OTP_IMAGE} - - OTP_TAG=${OTP_TAG} - - gtfs_url=${GTFS_URL} - - osm_pbf_url=${OSM_URL} - - memory=${GRAPH_BUILD_MEMORY} - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost"] - interval: 15s - timeout: 10s - retries: 30 + retries: 30 diff --git a/03-running-otp-and-digitransit/otp-config.json b/03-running-otp-and-digitransit/otp-config.json new file mode 100644 index 0000000..7a16e4f --- /dev/null +++ b/03-running-otp-and-digitransit/otp-config.json @@ -0,0 +1,6 @@ +{ + "otpFeatures" : { + "SandboxAPILegacyGraphQLApi": true, + "SandboxAPIMapboxVectorTilesApi": true + } +} From e8f0255da832293b5b017be30e4a489034de26d4 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 9 Aug 2021 11:23:50 +0200 Subject: [PATCH 18/23] Update step 03 --- 02-otp-and-graph-building/Dockerfile | 2 +- 02-otp-and-graph-building/docker-compose.yml | 3 ++- 03-running-otp-and-digitransit/.env | 6 +++--- 03-running-otp-and-digitransit/docker-compose.yml | 8 ++++++++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/02-otp-and-graph-building/Dockerfile b/02-otp-and-graph-building/Dockerfile index a8250b6..942d53f 100644 --- a/02-otp-and-graph-building/Dockerfile +++ b/02-otp-and-graph-building/Dockerfile @@ -28,7 +28,7 @@ ADD $GTFS_URL /opt/opentripplanner/build/gtfs.zip RUN java -jar otp-shaded.jar --version | tee build/version.txt # build -RUN java -Xmx$MEMORY -jar otp-shaded.jar --build --save /opt/opentripplanner/build/ | tee build/build.log +RUN java -Xmx$MEMORY -jar otp-shaded.jar --build --save /opt/opentripplanner/build/ # ENTRYPOINT java -Xmx$MEMORY -jar otp-shaded.jar --load --serve /opt/opentripplanner/build/ diff --git a/02-otp-and-graph-building/docker-compose.yml b/02-otp-and-graph-building/docker-compose.yml index 5785037..7141838 100644 --- a/02-otp-and-graph-building/docker-compose.yml +++ b/02-otp-and-graph-building/docker-compose.yml @@ -1,7 +1,8 @@ version: '3' services: - opentripplanner-with-graph: + opentripplanner: + image: ${OTP_IMAGE}:${OTP_TAG} build: context: . args: diff --git a/03-running-otp-and-digitransit/.env b/03-running-otp-and-digitransit/.env index c807a3e..d7f593a 100644 --- a/03-running-otp-and-digitransit/.env +++ b/03-running-otp-and-digitransit/.env @@ -1,9 +1,9 @@ # --- Digitransit Config -ROUTER=ludwigsburg +ROUTER=hbnext # API URL (usually starts with api., for development, you'll probably need to configure /etc/hosts to map api.localhost to 127.0.0.1) API_URL=http://api.localhost:8080 -DT_IMAGE=mfdz/digitransit-ui -DT_TAG=latest +DT_IMAGE=stadtnavi/digitransit-ui +DT_TAG=next # --- OpenTripPlanner Config # URL to the GTFS feed used for routing GTFS_URL=https://www.openvvs.de/dataset/e66f03e4-79f2-41d0-90f1-166ca609e491/resource/bfbb59c7-767c-4bca-bbb2-d8d32a3e0378/download/google_transit.zip diff --git a/03-running-otp-and-digitransit/docker-compose.yml b/03-running-otp-and-digitransit/docker-compose.yml index a150fdf..92a7c6a 100644 --- a/03-running-otp-and-digitransit/docker-compose.yml +++ b/03-running-otp-and-digitransit/docker-compose.yml @@ -23,6 +23,14 @@ services: - "opentripplanner" opentripplanner: image: ${OTP_IMAGE}:${OTP_TAG} + build: + context: . + args: + - OTP_IMAGE=${OTP_IMAGE} + - OTP_TAG=${OTP_TAG} + - gtfs_url=${GTFS_URL} + - osm_pbf_url=${OSM_URL} + - memory=${GRAPH_BUILD_MEMORY} ports: - "${OTP_PORT}:8080" healthcheck: From b06b367d480e8710e9eb9faaa448da34e425dbd5 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 9 Aug 2021 12:45:01 +0200 Subject: [PATCH 19/23] Correct formatting --- 01-installing-and-running-ui/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/01-installing-and-running-ui/README.md b/01-installing-and-running-ui/README.md index db4d359..03b2be2 100644 --- a/01-installing-and-running-ui/README.md +++ b/01-installing-and-running-ui/README.md @@ -181,7 +181,7 @@ In the console you will see this message `Digitransit-ui available on port 8080` * modify the `APP_TITLE` variable located in app/configurations/config..js * `config.rt.js` * Replace the content of `config.rt.js` with the following code: - ``` +``` /* eslint-disable */ import configMerger from '../util/configMerger'; @@ -232,7 +232,6 @@ export default configMerger(walttiConfig, { PELIAS_PLACE: `${ process.env.GEOCODING_BASE_URL || GEOCODING_BASE_URL }/place`, - FARES: `${API_URL}/fares`, FONT: '' // Do not use Google fonts. }, @@ -572,7 +571,7 @@ export default configMerger(walttiConfig, { viaPointsEnabled: false, }); - ``` + ``` ### 6. Show results From feb79f6cd60d9cb514715c4b73c345049e0767e4 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 9 Aug 2021 13:36:27 +0200 Subject: [PATCH 20/23] Reduce chapter one options to bare minimum --- 01-installing-and-running-ui/README.md | 176 +++---------------------- 1 file changed, 21 insertions(+), 155 deletions(-) diff --git a/01-installing-and-running-ui/README.md b/01-installing-and-running-ui/README.md index 03b2be2..7fa080a 100644 --- a/01-installing-and-running-ui/README.md +++ b/01-installing-and-running-ui/README.md @@ -182,7 +182,7 @@ In the console you will see this message `Digitransit-ui available on port 8080` * `config.rt.js` * Replace the content of `config.rt.js` with the following code: ``` - /* eslint-disable */ +/* eslint-disable */ import configMerger from '../util/configMerger'; const CONFIG = 'rt'; @@ -192,7 +192,7 @@ const API_URL = process.env.API_URL || 'https://api.stadtnavi.de'; const MAP_URL = process.env.MAP_URL || 'https://tiles.stadtnavi.eu/streets/{z}/{x}/{y}{r}.png'; const SEMI_TRANSPARENT_MAP_URL = process.env.SEMITRANSPARENT_MAP_URL || "https://tiles.stadtnavi.eu/satellite-overlay/{z}/{x}/{y}{r}.png"; const GEOCODING_BASE_URL = process.env.GEOCODING_BASE_URL || "https://photon.stadtnavi.eu/pelias/v1"; -const YEAR = 1900 + new Date().getYear(); +const YEAR = 1901 + new Date().getYear(); const STATIC_MESSAGE_URL = process.env.STATIC_MESSAGE_URL || '/assets/messages/message.hb.json'; @@ -203,10 +203,10 @@ const realtimeHbg = require('./realtimeUtils').default.hbg; const hostname = new URL(API_URL); realtimeHbg.mqtt = `wss://${hostname.host}/mqtt/`; -const minLat = 47.6020; -const maxLat = 49.0050; -const minLon = 8.4087; -const maxLon = 9.9014; +const minLat = 48.6020; +const maxLat = 50.0050; +const minLon = 9.4087; +const maxLon = 10.9014; export default configMerger(walttiConfig, { CONFIG, @@ -242,6 +242,16 @@ export default configMerger(walttiConfig, { availableLanguages: ['de', 'en'], defaultLanguage: 'de', + transportModes: { + rail: { + availableForSelection: true, + defaultValue: true, + }, + subway: { + availableForSelection: true, + defaultValue: true, + }, + }, /* disable the "next" column of the Route panel as it can be confusing sometimes: https://github.com/stadtnavi/digitransit-ui/issues/167 */ displayNextDeparture: false, maxWalkDistance: 15000, @@ -276,36 +286,12 @@ export default configMerger(walttiConfig, { sprites: 'assets/svg-sprite.hb.svg', - dynamicParkingLots: { - showDynamicParkingLots: true, - dynamicParkingLotsSmallIconZoom: 14, - dynamicParkingLotsMinZoom: 14 - }, - bikeParks: { show: true, smallIconZoom: 14, minZoom: 14 }, - roadworks: { - showRoadworks: true, - roadworksSmallIconZoom: 16, - roadworksMinZoom: 10 - }, - - weatherStations: { - show: true, - smallIconZoom: 17, - minZoom: 15 - }, - - chargingStations: { - show: true, - smallIconZoom: 14, - minZoom: 14 - }, - cityBike: { minZoomStopsNearYou: 10, showStationId: false, @@ -375,8 +361,6 @@ export default configMerger(walttiConfig, { feedIds: ['hbg'], - realtime: { hbg: realtimeHbg }, - searchSources: ['oa', 'osm'], searchParams: { @@ -405,103 +389,23 @@ export default configMerger(walttiConfig, { menu: { copyright: { - label: `© Stadt Herrenberg ${YEAR}` + label: `© Digitransit ${YEAR}` }, content: [ - { - name: 'about-this-service', - nameEn: 'About this service', - route: '/dieser-dienst', - icon: 'icon-icon_info', - }, - { - name: 'imprint', - nameEn: 'Imprint', - href: 'https://www.herrenberg.de/impressum', - }, - { - name: 'privacy', - nameEn: 'Privacy', - href: 'https://www.herrenberg.de/datenschutz', - }, ], }, aboutThisService: { de: [ - { - header: 'Über diesen Dienst', - paragraphs: [ - 'stadtnavi ist eine Reiseplanungs-Anwendung für die Stadt Herrenberg und Umgebung. Dieser Dienst umfasst ÖPNV, Fußwege, Radverkehr, Straßen- und Parkplatzinformationen, Ladeinfrastruktur und Sharing-Angebote. Mobilitätsangebote werden durch intermodales Routing miteinander vernetzt.', - 'Gefördert durch
', - '', - - ], - }, - { - header: 'Mitmachen', - paragraphs: [ - 'Die Stadt Herrenberg hat diese App im Rahmen der Modellstadt, gefördert durch das Bundesministerium für Verkehr und digitale Infrastruktur (BMVI) entwickelt. stadtnavi Anwendung ist eine Open Source Lösung und kann von anderen Kommunen und Akteuren unter ihrem Namen und Erscheinungsbild verwendet und an individuelle Bedürfnisse angepasst und weiterentwickelt werden (White Label Lösung). Mitmachen ist gewünscht!', - ] - }, - { - header: 'Digitransit Plattform', - paragraphs: [ - 'Dieser Dienst basiert auf der Digitransit Platform und dem Backend-Dienst OpenTripPlanner. Alle Software ist unter einer offenen Lizenzen verfügbar. Vielen Dank an alle Beteiligten.', - 'Der gesamte Quellcode der Plattform, die aus vielen verschiedenen Komponenten besteht, ist auf Github verfügbar.' - ], - }, - { - header: 'Datenquellen', - paragraphs: [ - 'Kartendaten: © OpenStreetMap Mitwirkende', - 'ÖPNV-Daten: Datensätze der NVBW GmbH und der VVS GmbH, Shapes (d.h. Geometrien der Streckenverläufe) jeweils angereichert mit OpenStreetMap-Daten © OpenStreetMap Mitwirkende', - 'Alle Angaben ohne Gewähr.' - ], - }, ], en: [ - { - header: 'About this service', - paragraphs: [ - 'stadtnavi is a travel planning application for the city of Herrenberg and its surroundings. This service includes public transport, footpaths, cycling, street and parking information, charging infrastructure and sharing offerings. The mobility offerings are connected through intermodal routing.', - '', - ], - }, - { - header: 'Contribute', - paragraphs: [ - 'The city of Herrenberg has developed this app, funded by the Federal Ministry of Transport and Digital Infrastructure (BMVI), as model city. The stadtnavi app is an open source solution and can be used, customized and further developed by other municipalities to meet individual needs (white lable solution). Participation is welcome!', - ] - }, - { - header: 'Digitransit platform', - paragraphs: [ - 'The Digitransit service platform is an open source routing platform developed by HSL and Traficom. It builds on OpenTripPlanner by Conveyal. Enhancements by Transportkollektiv and MITFAHR|DE|ZENTRALE. All software is open source. Thanks to everybody working on this!', - ], - }, - { - header: 'Data sources', - paragraphs: [ - 'Map data: © OpenStreetMap contributors', - 'Public transit data: Datasets by NVBW GmbH and VVS GmbH, Shapes (d.h. Geometrien der Streckenverläufe) enhanced with OpenStreetMap data © OpenStreetMap contributors', - 'No responsibility is accepted for the accuracy of this information.' - ], - }, ], }, redirectReittiopasParams: true, - showTicketInformation: true, - showTicketPrice: true, - availableTickets: { 'hbg' : {}}, - fareMapping: function mapHbFareId(fareId) { - return { - en: "Adult", - de: "Regulär", - }; - }, + showTicketInformation: false, + showTicketPrice: false, displayFareInfoTop: false, showRouteSearch: false, @@ -510,44 +414,6 @@ export default configMerger(walttiConfig, { // adding assets/geoJson/hb-layers layers geoJson: { layers: [ - // bicycleinfrastructure includes shops, repair stations, - { - name: { - fi: '', - en: 'Service stations and stores', - de: "Service Stationen und Läden", - }, - url: '/assets/geojson/hb-layers/bicycleinfrastructure.geojson', - }, - /* Charging stations - { - name: { - fi: '', - en: 'Charging stations', - de: 'Ladestationen', - }, - url: '/assets/geojson/hb-layers/charging.geojson', - },*/ - // LoRaWan map layer - { - name: { - fi: '', - en: 'LoRaWAN Gateways', - de: 'LoRaWAN Gateways', - }, - url: '/assets/geojson/hb-layers/lorawan-gateways.geojson', - isOffByDefault: true, - }, - // Nette Toilette layer - { - name: { - fi: '', - en: 'Public Toilets', - de: 'Nette Toilette', - }, - url: '/assets/geojson/hb-layers/toilet.geojson', - isOffByDefault: true, - }, ], }, staticMessagesUrl: STATIC_MESSAGE_URL, @@ -571,8 +437,8 @@ export default configMerger(walttiConfig, { viaPointsEnabled: false, }); - ``` - +``` + ### 6. Show results To start the application in production mode: From 397d42842159d02c2c3eade5be7ec02b2a312c5f Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 18 Mar 2022 14:16:41 +0100 Subject: [PATCH 21/23] Use apt-get instead of zip --- 02-otp-and-graph-building/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/02-otp-and-graph-building/Dockerfile b/02-otp-and-graph-building/Dockerfile index 942d53f..97b3ac0 100644 --- a/02-otp-and-graph-building/Dockerfile +++ b/02-otp-and-graph-building/Dockerfile @@ -11,8 +11,7 @@ ENV OSM_PBF_URL=$osm_pbf_url ARG memory=31G ENV MEMORY=$memory -RUN apk add --update zip && \ - rm -rf /var/cache/apk/* +RUN apt-get update && apt-get install zip RUN mkdir -p /opt/opentripplanner/build/ From bcbf93a476aff73b99deded2d6528a7bcaf49b4f Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 18 Mar 2022 14:19:56 +0100 Subject: [PATCH 22/23] Add -y --- 02-otp-and-graph-building/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/02-otp-and-graph-building/Dockerfile b/02-otp-and-graph-building/Dockerfile index 97b3ac0..7f1d3ae 100644 --- a/02-otp-and-graph-building/Dockerfile +++ b/02-otp-and-graph-building/Dockerfile @@ -11,7 +11,7 @@ ENV OSM_PBF_URL=$osm_pbf_url ARG memory=31G ENV MEMORY=$memory -RUN apt-get update && apt-get install zip +RUN apt-get update && apt-get install zip -y RUN mkdir -p /opt/opentripplanner/build/ @@ -27,7 +27,7 @@ ADD $GTFS_URL /opt/opentripplanner/build/gtfs.zip RUN java -jar otp-shaded.jar --version | tee build/version.txt # build -RUN java -Xmx$MEMORY -jar otp-shaded.jar --build --save /opt/opentripplanner/build/ +RUN java -Xmx$MEMORY -jar otp-shaded.jar --build --save /opt/opentripplanner/build/ # ENTRYPOINT java -Xmx$MEMORY -jar otp-shaded.jar --load --serve /opt/opentripplanner/build/ From c59e9afd78a57a0280cd48cf35f0e6bb8f7c16ec Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 18 Mar 2022 14:23:08 +0100 Subject: [PATCH 23/23] Use apt-get not apk --- 03-running-otp-and-digitransit/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/03-running-otp-and-digitransit/Dockerfile b/03-running-otp-and-digitransit/Dockerfile index a8250b6..0d3af73 100644 --- a/03-running-otp-and-digitransit/Dockerfile +++ b/03-running-otp-and-digitransit/Dockerfile @@ -11,8 +11,7 @@ ENV OSM_PBF_URL=$osm_pbf_url ARG memory=31G ENV MEMORY=$memory -RUN apk add --update zip && \ - rm -rf /var/cache/apk/* +RUN apt-get update && apt-get install zip -y RUN mkdir -p /opt/opentripplanner/build/