Skip to content

Commit

Permalink
feat(core-utils): Add support for routing based on mobility profile
Browse files Browse the repository at this point in the history
  • Loading branch information
binh-dam-ibigroup committed Dec 28, 2023
1 parent ced0c5d commit 94612cd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/core-utils/src/otpSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7662,6 +7662,16 @@
"ofType": null
},
"defaultValue": null
},
{
"name": "mobilityProfile",
"description": "Preferences for routing based on mobility profile",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
}
],
"type": {
Expand Down
2 changes: 2 additions & 0 deletions packages/core-utils/src/planQuery.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ query Plan(
$carReluctance: Float
$date: String
$fromPlace: String!
$mobilityProfile: String
$modes: [TransportMode]
$numItineraries: Int
$preferred: InputPreferred
Expand All @@ -24,6 +25,7 @@ query Plan(
fromPlace: $fromPlace
# Currently only supporting EN locale, used for times and text
locale: "en"
mobilityProfile: $mobilityProfile
numItineraries: $numItineraries
preferred: $preferred
time: $time
Expand Down
3 changes: 3 additions & 0 deletions packages/core-utils/src/query-gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type OTPQueryParams = {
arriveBy: boolean;
date?: string;
from: LonLatOutput & { name?: string };
mobilityProfile?: string;
modes: TransportMode[];
modeSettings: ModeSetting[];
time?: string;
Expand Down Expand Up @@ -217,6 +218,7 @@ export function generateOtp2Query(
banned,
date,
from,
mobilityProfile,
modes,
modeSettings,
numItineraries,
Expand Down Expand Up @@ -258,6 +260,7 @@ export function generateOtp2Query(
carReluctance,
date,
fromPlace: `${from.name}::${from.lat},${from.lon}}`,
mobilityProfile,
modes,
numItineraries,
preferred,
Expand Down

0 comments on commit 94612cd

Please sign in to comment.