@opentripplanner/core-utils 10.0.0-alpha.5 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2292,7 +2292,7 @@
2292
2292
  "fields": [
2293
2293
  {
2294
2294
  "name": "id",
2295
- "description": "Identifier local to the itinerary that allows to cross-reference and deduplicate\nfare products that span more than one leg.\n\nIf you want to uniquely identify the fare product itself (not its use) use the product's `id`.\n\n### Example: Day pass\n\nWhen a day pass is valid for all three legs in the itinerary it will appear\nfor each leg but with the same use-`id`.\n\n*It is the responsibility of the API consumers to display the day pass as a product for the\nentire itinerary rather than three day passes!*\n\n### Example: Several single tickets\n\nIf you have two legs and need to buy two single tickets they will appear in each leg with the\nsame `product.id` but different use-`id`.",
2295
+ "description": "Represents the use of a single instance of a fare product throughout the itinerary. It can\nbe used to cross-reference and de-duplicate fare products that are applicable for more than one\nleg.\n\nIf you want to uniquely identify the fare product itself (not its use) use the product's `id`.\n\n### Example: Day pass\n\nThe day pass is valid for both legs in the itinerary. It is listed as the applicable `product` for each leg,\nand the same FareProductUse id is shown, indicating that only one pass was used/bought.\n\n**Illustration**\n```yaml\nitinerary:\n leg1:\n fareProducts:\n id: \"AAA\" // id of a FareProductUse instance\n product:\n id: \"day-pass\" // product id\n name: \"Day Pass\"\n leg2:\n fareProducts:\n id: \"AAA\" // identical to leg1. the passenger needs to buy ONE pass, not two.\n product:\n id: \"day-pass\" // product id\n name: \"Day Pass\"\n```\n\n**It is the responsibility of the API consumers to display the day pass as a product for the\nentire itinerary rather than two day passes!**\n\n### Example: Several single tickets\n\nIf you have two legs and need to buy two single tickets they will appear in each leg with the\nsame `FareProduct.id` but different `FareProductUse.id`.\n\n**Illustration**\n```yaml\nitinerary:\n leg1:\n fareProducts:\n id: \"AAA\" // id of a FareProductUse instance, not product id\n product:\n id: \"single-ticket\" // product id\n name: \"Single Ticket\"\n leg2:\n fareProducts:\n id: \"BBB\" // different to leg1. the passenger needs to buy two single tickets.\n product:\n id: \"single-ticket\" // product id\n name: \"Single Ticket\"\n```",
2296
2296
  "args": [],
2297
2297
  "type": {
2298
2298
  "kind": "NON_NULL",
@@ -3558,7 +3558,7 @@
3558
3558
  },
3559
3559
  {
3560
3560
  "name": "steps",
3561
- "description": null,
3561
+ "description": "The turn-by-turn navigation instructions.",
3562
3562
  "args": [],
3563
3563
  "type": {
3564
3564
  "kind": "LIST",
@@ -3572,6 +3572,18 @@
3572
3572
  "isDeprecated": false,
3573
3573
  "deprecationReason": null
3574
3574
  },
3575
+ {
3576
+ "name": "headsign",
3577
+ "description": "For transit legs, the headsign that the vehicle shows at the stop where the passenger boards.\nFor non-transit legs, null.",
3578
+ "args": [],
3579
+ "type": {
3580
+ "kind": "SCALAR",
3581
+ "name": "String",
3582
+ "ofType": null
3583
+ },
3584
+ "isDeprecated": false,
3585
+ "deprecationReason": null
3586
+ },
3575
3587
  {
3576
3588
  "name": "pickupType",
3577
3589
  "description": "This is used to indicate if boarding this leg is possible only with special arrangements.",
@@ -8446,49 +8458,43 @@
8446
8458
  "enumValues": [
8447
8459
  {
8448
8460
  "name": "NO_TRANSIT_CONNECTION",
8449
- "description": "No transit connection was found between the origin and destination withing the operating day or the next day",
8461
+ "description": "No transit connection was found between the origin and destination within the operating day or\nthe next day, not even sub-optimal ones.",
8450
8462
  "isDeprecated": false,
8451
8463
  "deprecationReason": null
8452
8464
  },
8453
8465
  {
8454
8466
  "name": "NO_TRANSIT_CONNECTION_IN_SEARCH_WINDOW",
8455
- "description": "Transit connection was found, but it was outside the search window, see metadata for the next search window",
8467
+ "description": "A transit connection was found, but it was outside the search window. See the metadata for a token\nfor retrieving the result outside the search window.",
8456
8468
  "isDeprecated": false,
8457
8469
  "deprecationReason": null
8458
8470
  },
8459
8471
  {
8460
8472
  "name": "OUTSIDE_SERVICE_PERIOD",
8461
- "description": "The date specified is outside the range of data currently loaded into the system",
8473
+ "description": "The date specified is outside the range of data currently loaded into the system as it is too\nfar into the future or the past.\n\nThe specific date range of the system is configurable by an administrator and also depends on\nthe input data provided.",
8462
8474
  "isDeprecated": false,
8463
8475
  "deprecationReason": null
8464
8476
  },
8465
8477
  {
8466
8478
  "name": "OUTSIDE_BOUNDS",
8467
- "description": "The coordinates are outside the bounds of the data currently loaded into the system",
8479
+ "description": "The coordinates are outside the geographic bounds of the transit and street data currently loaded\ninto the system and therefore cannot return any results.",
8468
8480
  "isDeprecated": false,
8469
8481
  "deprecationReason": null
8470
8482
  },
8471
8483
  {
8472
8484
  "name": "LOCATION_NOT_FOUND",
8473
- "description": "The specified location is not close to any streets or transit stops",
8485
+ "description": "The specified location is not close to any streets or transit stops currently loaded into the\nsystem, even though it is generally within its bounds.\n\nThis can happen when there is only transit but no street data coverage at the location in\nquestion.",
8474
8486
  "isDeprecated": false,
8475
8487
  "deprecationReason": null
8476
8488
  },
8477
8489
  {
8478
8490
  "name": "NO_STOPS_IN_RANGE",
8479
- "description": "No stops are reachable from the location specified. You can try searching using a different access or egress mode",
8491
+ "description": "No stops are reachable from the start or end locations specified.\n\nYou can try searching using a different access or egress mode, for example cycling instead of walking,\nincrease the walking/cycling/driving speed or have an administrator change the system's configuration\nso that stops further away are considered.",
8480
8492
  "isDeprecated": false,
8481
8493
  "deprecationReason": null
8482
8494
  },
8483
8495
  {
8484
8496
  "name": "WALKING_BETTER_THAN_TRANSIT",
8485
- "description": "The origin and destination are so close to each other, that walking is always better, but no direct mode was specified for the search",
8486
- "isDeprecated": false,
8487
- "deprecationReason": null
8488
- },
8489
- {
8490
- "name": "SYSTEM_ERROR",
8491
- "description": "An unknown error happened during the search. The details have been logged to the server logs",
8497
+ "description": "Transit connections were requested and found but because it is easier to just walk all the way\nto the destination they were removed.\n\nIf you want to still show the transit results, you need to make walking less desirable by\nincreasing the walk reluctance.",
8492
8498
  "isDeprecated": false,
8493
8499
  "deprecationReason": null
8494
8500
  }
@@ -9433,18 +9439,6 @@
9433
9439
  "isDeprecated": false,
9434
9440
  "deprecationReason": null
9435
9441
  },
9436
- {
9437
- "name": "stopPosition",
9438
- "description": "The sequence of the stop in the pattern. This is not required to start from 0 or be consecutive - any\nincreasing integer sequence along the stops is valid.\n\nThe purpose of this field is to identify the stop within the pattern so it can be cross-referenced\nbetween it and the itinerary. It is safe to cross-reference when done quickly, i.e. within seconds.\nHowever, it should be noted that realtime updates can change the values, so don't store it for\nlonger amounts of time.\n\nDepending on the source data, this might not be the GTFS `stop_sequence` but another value, perhaps\neven generated.",
9439
- "args": [],
9440
- "type": {
9441
- "kind": "SCALAR",
9442
- "name": "Int",
9443
- "ofType": null
9444
- },
9445
- "isDeprecated": false,
9446
- "deprecationReason": null
9447
- },
9448
9442
  {
9449
9443
  "name": "scheduledArrival",
9450
9444
  "description": "Scheduled arrival time. Format: seconds since midnight of the departure date",
@@ -10071,7 +10065,7 @@
10071
10065
  "args": [
10072
10066
  {
10073
10067
  "name": "language",
10074
- "description": "If translated headsign is found from gtfs translation.txt and wanted language is not same as\nfeed's language then returns wanted translation. Otherwise uses name from trip_headsign.txt.",
10068
+ "description": "If a translated headsign is found from GTFS translation.txt and wanted language is not same as\nfeed's language then returns wanted translation. Otherwise uses name from trip_headsign.txt.",
10075
10069
  "type": {
10076
10070
  "kind": "SCALAR",
10077
10071
  "name": "String",
@@ -1,27 +1,19 @@
1
- fragment StopParameters on Stop {
2
- code
3
- gtfsId
4
- name
5
- id
6
- lat
7
- lon
8
- }
9
-
10
1
  query Plan(
11
- $fromPlace: String!
12
- $toPlace: String!
13
- $modes: [TransportMode]
14
- $time: String
15
- $date: String
16
- $wheelchair: Boolean
2
+ $arriveBy: Boolean
3
+ $banned: InputBanned
17
4
  $bikeReluctance: Float
18
5
  $carReluctance: Float
19
- $walkReluctance: Float
20
- $arriveBy: Boolean
6
+ $date: String
7
+ $fromPlace: String!
8
+ $modes: [TransportMode]
9
+ $numItineraries: Int
21
10
  $preferred: InputPreferred
11
+ $time: String
12
+ $toPlace: String!
22
13
  $unpreferred: InputUnpreferred
23
- $banned: InputBanned
24
- $numItineraries: Int
14
+ $walkReluctance: Float
15
+ $walkSpeed: Float
16
+ $wheelchair: Boolean
25
17
  ) {
26
18
  plan(
27
19
  arriveBy: $arriveBy
@@ -39,6 +31,7 @@ query Plan(
39
31
  transportModes: $modes
40
32
  unpreferred: $unpreferred
41
33
  walkReluctance: $walkReluctance
34
+ walkSpeed: $walkSpeed
42
35
  wheelchair: $wheelchair
43
36
  ) {
44
37
  itineraries {
@@ -107,10 +100,13 @@ query Plan(
107
100
  effectiveStartDate
108
101
  id
109
102
  }
110
- ...StopParameters
103
+ code
104
+ gtfsId
105
+ id
111
106
  }
112
107
  vertexType
113
108
  }
109
+ headsign
114
110
  interlineWithPreviousLeg
115
111
  intermediateStops {
116
112
  lat
@@ -205,7 +201,9 @@ query Plan(
205
201
  effectiveStartDate
206
202
  id
207
203
  }
208
- ...StopParameters
204
+ code
205
+ gtfsId
206
+ id
209
207
  }
210
208
  vertexType
211
209
  }
@@ -213,19 +211,20 @@ query Plan(
213
211
  trip {
214
212
  arrivalStoptime {
215
213
  stop {
216
- ...StopParameters
214
+ gtfsId
215
+ id
217
216
  }
218
217
  stopPosition
219
218
  }
220
219
  departureStoptime {
221
220
  stop {
222
- ...StopParameters
221
+ gtfsId
222
+ id
223
223
  }
224
224
  stopPosition
225
225
  }
226
226
  gtfsId
227
227
  id
228
- tripHeadsign
229
228
  }
230
229
  }
231
230
  startTime
package/src/profile.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export function filterProfileOptions(response) {
2
- // Filter out similar options. TODO: handle on server??
2
+ // Filter out similar options. TODO: handle on server?
3
3
  const optStrs = [];
4
4
  const filteredIndices = [];
5
5
 
package/src/query-gen.ts CHANGED
@@ -57,7 +57,7 @@ export function extractAdditionalModes(
57
57
  return prev;
58
58
  }
59
59
 
60
- // In checkboxes (or submode checkboxes), mode must be enabled and have a transport mode in it
60
+ // In checkboxes, mode must be enabled and have a transport mode in it
61
61
  if (
62
62
  (cur.type === "CHECKBOX" || cur.type === "SUBMODE") &&
63
63
  cur.addTransportMode &&
@@ -239,6 +239,7 @@ export function generateOtp2Query(
239
239
  const {
240
240
  bikeReluctance,
241
241
  carReluctance,
242
+ walkSpeed,
242
243
  walkReluctance,
243
244
  wheelchair
244
245
  } = modeSettingValues;
@@ -258,6 +259,7 @@ export function generateOtp2Query(
258
259
  time,
259
260
  toPlace: `${to.name}::${to.lat},${to.lon}}`,
260
261
  walkReluctance,
262
+ walkSpeed,
261
263
  wheelchair
262
264
  }
263
265
  };
@@ -365,31 +365,6 @@ const queryParams = [
365
365
  }
366
366
  ]
367
367
  },
368
-
369
- {
370
- /* walkSpeed -- the user's walking speed in m/s */
371
- name: "walkSpeed",
372
- routingTypes: ["ITINERARY", "PROFILE"],
373
- default: 1.34,
374
- selector: "DROPDOWN",
375
- label: "Walk Speed",
376
- applicable: query => query.mode && query.mode.indexOf("WALK") !== -1,
377
- options: [
378
- {
379
- text: "2 MPH",
380
- value: 0.89
381
- },
382
- {
383
- text: "3 MPH",
384
- value: 1.34
385
- },
386
- {
387
- text: "4 MPH",
388
- value: 1.79
389
- }
390
- ]
391
- },
392
-
393
368
  {
394
369
  name: "walkReluctance",
395
370
  routingTypes: ["ITINERARY", "PROFILE"],
package/src/query.js CHANGED
@@ -19,7 +19,6 @@ export const defaultParams = [
19
19
  "maxWalkDistance",
20
20
  "walkReluctance",
21
21
  "maxWalkTime",
22
- "walkSpeed",
23
22
  "maxBikeDistance",
24
23
  "maxBikeTime",
25
24
  "bikeSpeed",