diff --git a/client/src/components/Tours/planner/tourRouting.test.ts b/client/src/components/Tours/planner/tourRouting.test.ts index 5fc254183..cd34cd6d7 100644 --- a/client/src/components/Tours/planner/tourRouting.test.ts +++ b/client/src/components/Tours/planner/tourRouting.test.ts @@ -230,9 +230,9 @@ describe('routing on land, bike profiles and unreachable points (BIK-01)', () => ).toEqual({ unreachable: 1, snappedMeters: 400 }) }) - it('TOUR-ROUTING-033: a city walk goes on foot with no hiking limit and no choice of a hike (CW-01)', async () => { + it('TOUR-ROUTING-033: a city walk goes on foot with no hiking limit, no choice of a hike, and avoids ferries (CW-01)', async () => { valhallaRun.mockResolvedValueOnce(run([3, 4])) expect(await routeCityWalk(waypoints)).toMatchObject({ distanceMeters: 1500, durationSeconds: 300 }) - expect(valhallaRun).toHaveBeenCalledWith(waypoints, 'walking', [], undefined, {}) + expect(valhallaRun).toHaveBeenCalledWith(waypoints, 'walking', [], undefined, { use_ferry: 0 }) }) }) diff --git a/client/src/components/Tours/planner/tourRouting.ts b/client/src/components/Tours/planner/tourRouting.ts index 10cf5e6c2..db07edac1 100644 --- a/client/src/components/Tours/planner/tourRouting.ts +++ b/client/src/components/Tours/planner/tourRouting.ts @@ -106,15 +106,19 @@ export async function routeWalkingTour( /** * CW-01: a city walk, on foot between its stations. No hiking limit is sent, * so the router keeps to the ways it takes for walking anyway (T1), and no - * route choice of a hike. + * route choice of a hike. Ferries are avoided: a walk is walked, and with the + * router's default Venice was crossed on the vaporetto lines instead of the + * bridges. Where no way on land exists the router still takes the ferry. */ export async function routeCityWalk( waypoints: LandWaypoint[], signal?: AbortSignal, ): Promise { - return routeOnLand(waypoints, 'walking', {}, signal) + return routeOnLand(waypoints, 'walking', CITY_WALK_COSTING, signal) } +const CITY_WALK_COSTING: Readonly = { use_ferry: 0 } + /** BIK-01: a bike tour, routed for its profile; a leg drawn by hand is kept as drawn. */ export async function routeBikeTour( waypoints: LandWaypoint[],