Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev-2.x' into upstream-merge-2…
Browse files Browse the repository at this point in the history
…024-02-16
  • Loading branch information
leonardehrenfried committed Feb 16, 2024
2 parents cd11987 + fb014bf commit 6e7fc12
Show file tree
Hide file tree
Showing 141 changed files with 104,767 additions and 2,099 deletions.
1 change: 1 addition & 0 deletions .github/workflows/debug-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
run: |
npm install
npm run build -- --base https://cdn.jsdelivr.net/gh/opentripplanner/debug-client-assets@main/${VERSION}/
npm run coverage
- name: Deploy compiled assets to repo
if: github.event_name == 'push' && github.ref == 'refs/heads/dev-2.x'
Expand Down
5,887 changes: 4,095 additions & 1,792 deletions client-next/package-lock.json

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions client-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"test": "vitest --root src/",
"coverage": "vitest run --root src/ --coverage",
"lint": "eslint . --report-unused-disable-directives --max-warnings 0",
"check-format": "prettier --check \"**/*.{js,jsx,ts,tsx,json,css,scss,md}\"",
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,css,scss,md}\"",
Expand All @@ -17,9 +19,9 @@
"dependencies": {
"@googlemaps/polyline-codec": "1.0.28",
"bootstrap": "5.3.1",
"graphql": "16.8.0",
"graphql": "16.8.1",
"graphql-request": "6.1.0",
"maplibre-gl": "3.6.2",
"maplibre-gl": "4.0.1",
"react": "18.2.0",
"react-bootstrap": "2.8.0",
"react-dom": "18.2.0",
Expand All @@ -30,20 +32,24 @@
"@graphql-codegen/client-preset": "4.1.0",
"@graphql-codegen/introspection": "4.0.0",
"@parcel/watcher": "2.3.0",
"@testing-library/react": "14.1.2",
"@types/react": "18.2.21",
"@types/react-dom": "18.2.7",
"@typescript-eslint/eslint-plugin": "6.5.0",
"@typescript-eslint/parser": "6.5.0",
"@vitejs/plugin-react": "4.0.4",
"@vitest/coverage-v8": "1.1.3",
"eslint": "8.48.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-import": "2.28.1",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-react-refresh": "0.4.3",
"jsdom": "24.0.0",
"prettier": "3.0.3",
"typescript": "5.2.2",
"vite": "4.4.9"
"vite": "4.5.2",
"vitest": "1.1.3"
}
}
2,394 changes: 2,394 additions & 0 deletions client-next/src/components/ItineraryList/ItineraryList.test.tsx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client-next/src/components/MapView/MapView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function MapView({
}}
// it's unfortunate that you have to list these layers here.
// maybe there is a way around it: https://github.com/visgl/react-map-gl/discussions/2343
interactiveLayerIds={['regular-stop', 'area-stop', 'vertex', 'edge', 'link']}
interactiveLayerIds={['regular-stop', 'area-stop', 'group-stop', 'vertex', 'edge', 'link']}
onClick={showFeaturePropPopup}
// put lat/long in URL and pan to it on page reload
hash={true}
Expand Down
14 changes: 14 additions & 0 deletions client-next/src/components/SearchBar/SearchBar.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { it } from 'vitest';
import { render } from '@testing-library/react';
import { SearchBar } from './SearchBar.tsx';
import { TripQueryVariables } from '../../gql/graphql.ts';

const variables: TripQueryVariables = {
from: { coordinates: { longitude: 9.795206, latitude: 60.13776 } },
to: { coordinates: { longitude: 11.50907, latitude: 59.85208 } },
dateTime: new Date().toISOString(),
};

it('renders without crashing', () => {
render(<SearchBar loading onRoute={() => {}} setTripQueryVariables={() => {}} tripQueryVariables={variables} />);
});
4 changes: 4 additions & 0 deletions client-next/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ export default defineConfig({
outDir: 'output',
emptyOutDir: true,
},
// @ts-ignore
test: {
environment: 'jsdom',
},
});
4 changes: 2 additions & 2 deletions doc-templates/Flex.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

To enable this turn on `FlexRouting` as a feature in `otp-config.json`.

The GTFS feeds should conform to
the [GTFS-Flex v2.1 draft](https://github.com/MobilityData/gtfs-flex/blob/master/spec/reference.md)
The GTFS feeds should conform to the
[GTFS-Flex v2 draft PR](https://github.com/google/transit/pull/388)

## Configuration

Expand Down
5 changes: 5 additions & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle
- Remove "fare" [#5645](https://github.com/opentripplanner/OpenTripPlanner/pull/5645)
- Refactor GroupStopBuilder addLocation method [#5651](https://github.com/opentripplanner/OpenTripPlanner/pull/5651)
- Remove `VehicleToStopHeuristics` [#5381](https://github.com/opentripplanner/OpenTripPlanner/pull/5381)
- Set defaults of the modes WALK, even if one and not the others are set [#5675](https://github.com/opentripplanner/OpenTripPlanner/pull/5675)
- Reduce flex default access/egress penalty [#5674](https://github.com/opentripplanner/OpenTripPlanner/pull/5674)
- Add scooter preferences [#5632](https://github.com/opentripplanner/OpenTripPlanner/pull/5632)
- Add GroupStop layer to new debug frontend [#5666](https://github.com/opentripplanner/OpenTripPlanner/pull/5666)
- Update to newest version of GTFS Flex location groups [#5655](https://github.com/opentripplanner/OpenTripPlanner/pull/5655)
[](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE)

## 2.4.0 (2023-09-13)
Expand Down
78 changes: 77 additions & 1 deletion docs/RouteRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,24 @@ and in the [transferRequests in build-config.json](BuildConfiguration.md#transfe
|       [costLimitFunction](#rd_if_transitGeneralizedCostLimit_costLimitFunction) | `cost-linear-function` | The base function used by the filter. | *Optional* | `"15m + 1.50 t"` | 2.2 |
|       [intervalRelaxFactor](#rd_if_transitGeneralizedCostLimit_intervalRelaxFactor) | `double` | How much the filter should be relaxed for itineraries that do not overlap in time. | *Optional* | `0.4` | 2.2 |
| [maxDirectStreetDurationForMode](#rd_maxDirectStreetDurationForMode) | `enum map of duration` | Limit direct route duration per street mode. | *Optional* | | 2.2 |
| scooter | `object` | Scooter preferences. | *Optional* | | 2.5 |
|    [optimization](#rd_scooter_optimization) | `enum` | The set of characteristics that the user wants to optimize for. | *Optional* | `"safe-streets"` | 2.0 |
|    reluctance | `double` | A multiplier for how bad scooter travel is, compared to being in transit for equal lengths of time. | *Optional* | `2.0` | 2.0 |
|    speed | `double` | Max scooter speed along streets, in meters per second | *Optional* | `5.0` | 2.0 |
|    rental | `object` | Vehicle rental options | *Optional* | | 2.3 |
|       allowKeepingAtDestination | `boolean` | If a vehicle should be allowed to be kept at the end of a station-based rental. | *Optional* | `false` | 2.2 |
|       dropOffCost | `integer` | Cost to drop-off a rented vehicle. | *Optional* | `30` | 2.0 |
|       dropOffTime | `duration` | Time to drop-off a rented vehicle. | *Optional* | `"PT30S"` | 2.0 |
|       keepingAtDestinationCost | `integer` | The cost of arriving at the destination with the rented vehicle, to discourage doing so. | *Optional* | `0` | 2.2 |
|       pickupCost | `integer` | Cost to rent a vehicle. | *Optional* | `120` | 2.0 |
|       pickupTime | `duration` | Time to rent a vehicle. | *Optional* | `"PT1M"` | 2.0 |
|       useAvailabilityInformation | `boolean` | Whether or not vehicle rental availability information will be used to plan vehicle rental trips. | *Optional* | `false` | 2.0 |
|       [allowedNetworks](#rd_scooter_rental_allowedNetworks) | `string[]` | The vehicle rental networks which may be used. If empty all networks may be used. | *Optional* | | 2.1 |
|       [bannedNetworks](#rd_scooter_rental_bannedNetworks) | `string[]` | The vehicle rental networks which may not be used. If empty, no networks are banned. | *Optional* | | 2.1 |
|    [triangle](#rd_scooter_triangle) | `object` | Triangle optimization criteria. | *Optional* | | 2.5 |
|       flatness | `double` | Relative importance of flat terrain (range 0-1). | *Optional* | `0.0` | 2.0 |
|       [safety](#rd_scooter_triangle_safety) | `double` | Relative importance of safety (range 0-1). | *Optional* | `0.0` | 2.0 |
|       time | `double` | Relative importance of duration of travel (range 0-1). | *Optional* | `0.0` | 2.0 |
| [transferOptimization](#rd_transferOptimization) | `object` | Optimize where a transfer between to trip happens. | *Optional* | | 2.1 |
|    [backTravelWaitTimeFactor](#rd_to_backTravelWaitTimeFactor) | `double` | To reduce back-travel we favor waiting, this reduces the cost of waiting. | *Optional* | `1.0` | 2.1 |
|    [extraStopBoardAlightCostsFactor](#rd_to_extraStopBoardAlightCostsFactor) | `double` | Add an extra board- and alight-cost for prioritized stops. | *Optional* | `0.0` | 2.1 |
Expand Down Expand Up @@ -411,7 +429,7 @@ The default values are
- `car-to-park` = (timePenalty: 20m + 2.0 t, costFactor: 1.50)
- `car-rental` = (timePenalty: 20m + 2.0 t, costFactor: 1.50)
- `car-hailing` = (timePenalty: 20m + 2.0 t, costFactor: 1.50)
- `flexible` = (timePenalty: 20m + 2.0 t, costFactor: 1.50)
- `flexible` = (timePenalty: 10m + 1.30 t, costFactor: 1.30)

Example: `"car-to-park" : { "timePenalty": "10m + 1.5t", "costFactor": 2.5 }`

Expand Down Expand Up @@ -832,6 +850,50 @@ Override the settings in `maxDirectStreetDuration` for specific street modes. Th
done because some street modes searches are much more resource intensive than others.


<h3 id="rd_scooter_optimization">optimization</h3>

**Since version:** `2.0`**Type:** `enum`**Cardinality:** `Optional`**Default value:** `"safe-streets"`
**Path:** /routingDefaults/scooter
**Enum values:** `shortest-duration` | `safe-streets` | `flat-streets` | `safest-streets` | `triangle`

The set of characteristics that the user wants to optimize for.

If the triangle optimization is used, it's enough to just define the triangle parameters

<h3 id="rd_scooter_rental_allowedNetworks">allowedNetworks</h3>

**Since version:** `2.1`**Type:** `string[]`**Cardinality:** `Optional`
**Path:** /routingDefaults/scooter/rental

The vehicle rental networks which may be used. If empty all networks may be used.

<h3 id="rd_scooter_rental_bannedNetworks">bannedNetworks</h3>

**Since version:** `2.1`**Type:** `string[]`**Cardinality:** `Optional`
**Path:** /routingDefaults/scooter/rental

The vehicle rental networks which may not be used. If empty, no networks are banned.

<h3 id="rd_scooter_triangle">triangle</h3>

**Since version:** `2.5`**Type:** `object`**Cardinality:** `Optional`
**Path:** /routingDefaults/scooter

Triangle optimization criteria.

Optimization type doesn't need to be defined if these values are defined.

<h3 id="rd_scooter_triangle_safety">safety</h3>

**Since version:** `2.0`**Type:** `double`**Cardinality:** `Optional`**Default value:** `0.0`
**Path:** /routingDefaults/scooter/triangle

Relative importance of safety (range 0-1).

This factor can also include other concerns such as convenience and general cyclist
preferences by taking into account road surface etc.


<h3 id="rd_transferOptimization">transferOptimization</h3>

**Since version:** `2.1`**Type:** `object`**Cardinality:** `Optional`
Expand Down Expand Up @@ -1098,6 +1160,20 @@ include stairs as a last result.
"cost" : 600
}
},
"scooter" : {
"speed" : 5,
"reluctance" : 5.0,
"rental" : {
"pickupCost" : 120,
"dropOffTime" : "30s",
"dropOffCost" : 30
},
"triangle" : {
"safety" : 0.4,
"flatness" : 0.3,
"time" : 0.3
}
},
"walk" : {
"speed" : 1.3,
"reluctance" : 4.0,
Expand Down
14 changes: 14 additions & 0 deletions docs/RouterConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,20 @@ Used to group requests when monitoring OTP.
"cost" : 600
}
},
"scooter" : {
"speed" : 5,
"reluctance" : 5.0,
"rental" : {
"pickupCost" : 120,
"dropOffTime" : "30s",
"dropOffCost" : 30
},
"triangle" : {
"safety" : 0.4,
"flatness" : 0.3,
"time" : 0.3
}
},
"walk" : {
"speed" : 1.3,
"reluctance" : 4.0,
Expand Down
25 changes: 0 additions & 25 deletions docs/SandboxExtension.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,6 @@
- This should not be used for bug fixes and smaller changes.
- Consider forking if the feature is valuable to one deployment only.

## Available extensions

Here is a list of features implemented as OTP Sandbox Extensions. The Sandbox extensions are
provided "as is".

- [Google Cloud Storage](sandbox/GoogleCloudStorage.md) - Enable Google Cloud Storage as a OTP Data Source
- [Actuator API](sandbox/ActuatorAPI.md) - API used to check the health status of the OTP instance.
- [Geocoder API](sandbox/GeocoderAPI.md) - Adds an API to search for stops and stations.
- [Transfer analyser](sandbox/transferanalyzer.md) - Module used for analyzing the transfers between
nearby stops generated by routing via OSM data.
- [SIRI Updater](sandbox/SiriUpdater.md) - Update OTP with real-time information from a Transmodel SIRI data source.
- [SIRI Azure Updater](sandbox/SiriAzureUpdater.md) - fetch SIRI real-time data through *Azure Service Bus*
- [VehicleRentalServiceDirectory](sandbox/VehicleRentalServiceDirectory.md) - GBFS service directory endpoint.
- [Smoove Bike Rental Updator Support](sandbox/SmooveBikeRental.md) - Smoove Bike Rental Updator(HSL)
- [Mapbox Vector Tiles API](sandbox/MapboxVectorTilesApi.md) - Mapbox Vector Tiles API
- [Flex Routing](sandbox/Flex.md) - Flexible transit routing for GTFS and Netex data sources
- [Park and Ride API](sandbox/ParkAndRideApi.md) - Park and Ride API
- [Data Overlay](sandbox/DataOverlay.md) - StreetEdge grid data populating affecting the route planning
- [Vehicle Parking](sandbox/VehicleParking.md) - Vehicle Parking updaters
- [Travel Time (Isochrone & Surface) API](sandbox/TravelTime.md) - Travel Time API
- [IBI accessibility score](sandbox/IBIAccessibilityScore.md) - IBI accessibility score
- [Fares](sandbox/Fares.md) - Fare calculation
- [Ride hailing](sandbox/RideHailing.md) - Ride hailing services like Uber


## Terminology

**Main/core** -- All OTP code and additional files, NOT part of the sandbox.
Expand Down
3 changes: 3 additions & 0 deletions docs/apis/GTFS-GraphQL-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ used heavily by [digitransit-ui](https://github.com/HSLdevcom/digitransit-ui).

[otp-react-redux](https://github.com/opentripplanner/otp-react-redux) has also migrated to this API in 2023.

There is also a [Java client](https://github.com/opentripplanner/otp-java-client) available which
makes it easy to use this API in a Java application.

## URLs
- GraphQL endpoint: [`http://localhost:8080/otp/gtfs/v1`](http://localhost:8080/otp/gtfs/v1)
- HTML schema documentation: [https://docs.opentripplanner.org/api/dev-2.x/graphql-gtfs/](https://docs.opentripplanner.org/api/dev-2.x/graphql-gtfs/)
Expand Down
9 changes: 9 additions & 0 deletions docs/examples/entur/router-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@
"dropOffCost": 30
}
},
"scooter": {
"speed": 5,
"reluctance": 5.0,
"rental": {
"pickupCost": 120,
"dropOffTime": "30s",
"dropOffCost": 30
}
},
"walk": {
"speed": 1.3,
"reluctance": 4.0,
Expand Down
11 changes: 11 additions & 0 deletions docs/examples/ibi/atlanta/router-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@
"pickupCost": 850
}
},
"scooter": {
"triangle": {
"time": 0.3,
"flatness": 0.3,
"safety": 0.4
},
"rental": {
"pickupTime": "3m",
"pickupCost": 850
}
},
"itineraryFilters": {
// only show non-transit (ie. walking) when it's at least as good as the transit option
"nonTransitGeneralizedCostLimit": "0 + 1.0 x",
Expand Down
4 changes: 2 additions & 2 deletions docs/sandbox/Flex.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

To enable this turn on `FlexRouting` as a feature in `otp-config.json`.

The GTFS feeds should conform to
the [GTFS-Flex v2.1 draft](https://github.com/MobilityData/gtfs-flex/blob/master/spec/reference.md)
The GTFS feeds should conform to the
[GTFS-Flex v2 draft PR](https://github.com/google/transit/pull/388)

## Configuration

Expand Down
Loading

0 comments on commit 6e7fc12

Please sign in to comment.