Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for routing based on mobility profile #696

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentripplanner/core-utils",
"version": "11.4.3",
"version": "11.4.3-mobility-profile",
"description": "Core functionality that is shared among numerous UI components",
"engines": {
"node": ">=13"
Expand Down
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 @@ -219,6 +220,7 @@ export function generateOtp2Query(
banned,
date,
from,
mobilityProfile,
modes,
modeSettings,
numItineraries,
Expand Down Expand Up @@ -261,6 +263,7 @@ export function generateOtp2Query(
carReluctance,
date,
fromPlace: `${from.name}::${from.lat},${from.lon}`,
mobilityProfile,
modes,
numItineraries,
preferred,
Expand Down
21 changes: 17 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4601,10 +4601,23 @@
resolved "https://registry.yarnpkg.com/@open-draft/until/-/until-2.1.0.tgz#0acf32f470af2ceaf47f095cdecd40d68666efda"
integrity sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==

"@opentripplanner/[email protected]":
version "6.5.0"
resolved "https://registry.yarnpkg.com/@opentripplanner/types/-/types-6.5.0.tgz#d8cca355bf30f0984283faa793113ad6c0dba38d"
integrity sha512-FllEyE+1WQ2GOSKXQOuzrk+OPcJEqr4+zacsHQLB9WVyfm5D/BPHR1/OjfuVngrwLTK5bKP8VlDRS1ba/R8rtg==
"@opentripplanner/core-utils@^11.4.1":
version "11.4.3"
resolved "https://registry.yarnpkg.com/@opentripplanner/core-utils/-/core-utils-11.4.3.tgz#4655f9a3bef1977e53abd81a4a0eae966f977c60"
integrity sha512-GbvchRsLfEi9JygUx6ypU+Iqv2hELseC53yQyQ/XdnB1kcHzN71BtBbz+qpD5/jk8IuM92j1taRnGMeu5ni6yA==
dependencies:
"@conveyal/lonlat" "^1.4.1"
"@mapbox/polyline" "^1.1.0"
"@opentripplanner/geocoder" "^3.0.0"
"@styled-icons/foundation" "^10.34.0"
"@turf/along" "^6.0.1"
chroma-js "^2.4.2"
date-fns "^2.28.0"
date-fns-tz "^1.2.2"
graphql "^16.6.0"
lodash.clonedeep "^4.5.0"
lodash.isequal "^4.5.0"
qs "^6.9.1"

"@opentripplanner/[email protected]":
version "6.5.0"
Expand Down
Loading