From 9c27ea6670cf715b129aeeb277a74fcabae50af8 Mon Sep 17 00:00:00 2001 From: Hannes <23156476+marecabo@users.noreply.github.com> Date: Sat, 4 Oct 2025 14:07:33 +0200 Subject: [PATCH 1/3] fix(graphhopper): Rename vehicle param to profile for routing requests Thsi fixes Street Snapping when editing shapes in the GTFS editor. When I tried it with a local Graphhopper instance before, I got the error message "bad request: profile parameter required" from the routing request. At some point, Graphhopper switched from a `vehicle` parameter to `profile`, see https://github.com/graphhopper/graphhopper/pull/1934. --- lib/scenario-editor/utils/valhalla.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/scenario-editor/utils/valhalla.js b/lib/scenario-editor/utils/valhalla.js index 408a8cec5..5b8992234 100644 --- a/lib/scenario-editor/utils/valhalla.js +++ b/lib/scenario-editor/utils/valhalla.js @@ -204,7 +204,7 @@ export async function getSegment ( /** * Call GraphHopper routing service with lat/lng coordinates. * - * Example URL: https://graphhopper.com/api/1/route?point=49.932707,11.588051&point=50.3404,11.64705&vehicle=car&debug=true&&type=json + * Example URL: https://graphhopper.com/api/1/route?point=49.932707,11.588051&point=50.3404,11.64705&profile=car&debug=true&&type=json */ export function routeWithGraphHopper (points: Array, avoidMotorways?: boolean): ?Promise { if (points.length < 2) { @@ -257,7 +257,7 @@ export function routeWithGraphHopper (points: Array, avoidMotorways?: bo const params = { key: graphHopperKey, - vehicle: 'car', + profile: 'car', debug: true, type: 'json' } @@ -277,7 +277,7 @@ export function routeWithGraphHopper (points: Array, avoidMotorways?: bo }, debug: params.debug, points: points.map(p => [p.lng, p.lat]), - profile: params.vehicle + profile: params.profile }), headers: { 'Content-Type': 'application/json' From b3fdad5256e37080bc59dbe208b9bf207604e0ca Mon Sep 17 00:00:00 2001 From: Hannes Rewald Date: Thu, 2 Apr 2026 15:37:32 +0200 Subject: [PATCH 2/3] fix: remove duplicate profile property --- lib/scenario-editor/utils/valhalla.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/scenario-editor/utils/valhalla.js b/lib/scenario-editor/utils/valhalla.js index 6b9503ce0..a59555c20 100644 --- a/lib/scenario-editor/utils/valhalla.js +++ b/lib/scenario-editor/utils/valhalla.js @@ -259,10 +259,8 @@ export function routeWithGraphHopper (points: Array, avoidMotorways?: bo profile: 'car', debug: true, type: 'json', - profile: '' } if (followRail) { - delete params.vehicle // vehicle is not supported in current open rail router version params.profile = 'all_tracks' // this can be changed to return better results if needed } const locations = points.map(p => (`point=${p.lat},${p.lng}`)).join('&') From b3780b1b5175a38a5f2e6ade2fc54ef1e636c9e2 Mon Sep 17 00:00:00 2001 From: Hannes Rewald Date: Thu, 2 Apr 2026 15:42:58 +0200 Subject: [PATCH 3/3] fix: fix dangling comma --- lib/scenario-editor/utils/valhalla.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/scenario-editor/utils/valhalla.js b/lib/scenario-editor/utils/valhalla.js index a59555c20..4fbb6fe91 100644 --- a/lib/scenario-editor/utils/valhalla.js +++ b/lib/scenario-editor/utils/valhalla.js @@ -258,7 +258,7 @@ export function routeWithGraphHopper (points: Array, avoidMotorways?: bo key: graphHopperKey, profile: 'car', debug: true, - type: 'json', + type: 'json' } if (followRail) { params.profile = 'all_tracks' // this can be changed to return better results if needed