Skip to content

Commit

Permalink
Merge remote-tracking branch 'otp/dev-2.x' into otp2_adr
Browse files Browse the repository at this point in the history
  • Loading branch information
t2gran committed Aug 28, 2024
2 parents cd9e973 + 05a057b commit 688b7bd
Show file tree
Hide file tree
Showing 120 changed files with 2,663 additions and 506 deletions.
252 changes: 132 additions & 120 deletions client/package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@
"bootstrap": "5.3.3",
"graphql": "16.9.0",
"graphql-request": "7.1.0",
"maplibre-gl": "4.5.0",
"maplibre-gl": "4.5.2",
"react": "18.3.1",
"react-bootstrap": "2.10.4",
"react-dom": "18.3.1",
"react-map-gl": "7.1.7"
},
"devDependencies": {
"@graphql-codegen/cli": "5.0.2",
"@graphql-codegen/client-preset": "4.3.2",
"@graphql-codegen/client-preset": "4.3.3",
"@graphql-codegen/introspection": "4.0.3",
"@parcel/watcher": "2.4.1",
"@testing-library/react": "16.0.0",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@typescript-eslint/eslint-plugin": "7.17.0",
"@typescript-eslint/parser": "7.17.0",
"@typescript-eslint/eslint-plugin": "7.18.0",
"@typescript-eslint/parser": "7.18.0",
"@vitejs/plugin-react": "4.3.1",
"@vitest/coverage-v8": "2.0.4",
"@vitest/coverage-v8": "2.0.5",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
Expand All @@ -49,7 +49,7 @@
"jsdom": "24.1.1",
"prettier": "3.3.3",
"typescript": "5.5.4",
"vite": "5.3.4",
"vitest": "2.0.4"
"vite": "5.4.1",
"vitest": "2.0.5"
}
}
13 changes: 4 additions & 9 deletions client/src/components/ItineraryList/ItineraryLegDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@ export function ItineraryLegDetails({ leg, isLast }: { leg: Leg; isLast: boolean
<div className="times">
{formatDistance(leg.distance)}, {formatDuration(leg.duration)}
</div>
<div>
<InterchangeInfo leg={leg} />
<LegTime
aimedTime={leg.aimedStartTime}
expectedTime={leg.expectedStartTime}
hasRealtime={leg.realtime}
/> - <LegTime aimedTime={leg.aimedEndTime} expectedTime={leg.expectedEndTime} hasRealtime={leg.realtime} />
</div>
<InterchangeInfo leg={leg} />
<LegTime aimedTime={leg.aimedStartTime} expectedTime={leg.expectedStartTime} hasRealtime={leg.realtime} /> -{' '}
<LegTime aimedTime={leg.aimedEndTime} expectedTime={leg.expectedEndTime} hasRealtime={leg.realtime} />
<div className="mode">
<b>{leg.mode}</b>{' '}
{leg.line && (
Expand All @@ -28,9 +23,9 @@ export function ItineraryLegDetails({ leg, isLast }: { leg: Leg; isLast: boolean
, {leg.authority?.name}
</>
)}{' '}
<div></div>
{leg.mode !== Mode.Foot && (
<>
<br />
<u title={leg.fromPlace.quay?.id}>{leg.fromPlace.name}</u>{' '}
</>
)}{' '}
Expand Down
2 changes: 1 addition & 1 deletion client/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', 'group-stop', 'vertex', 'edge', 'link']}
interactiveLayerIds={['regular-stop', 'area-stop', 'group-stop', 'parking-vertex', 'vertex', 'edge', 'link']}
onClick={showFeaturePropPopup}
// put lat/long in URL and pan to it on page reload
hash={true}
Expand Down
2 changes: 1 addition & 1 deletion client/src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
}

.itinerary-leg-details .mode {
margin-top: 10px;
margin-top: 2px;
}

.itinerary-header-itinerary-number {
Expand Down
4 changes: 2 additions & 2 deletions client/src/util/getColorForMode.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Mode } from '../gql/graphql.ts';

export const getColorForMode = function (mode: Mode) {
if (mode === Mode.Foot) return '#444';
if (mode === Mode.Foot) return '#191616';
if (mode === Mode.Bicycle) return '#5076D9';
if (mode === Mode.Scooter) return '#253664';
if (mode === Mode.Car) return '#444';
if (mode === Mode.Car) return '#7e7e7e';
if (mode === Mode.Rail) return '#86BF8B';
if (mode === Mode.Coach) return '#25642A';
if (mode === Mode.Metro) return '#D9B250';
Expand Down
10 changes: 10 additions & 0 deletions doc/templates/VehicleParking.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ All updaters have the following parameters in common:

<!-- INSERT: bikeep -->

## SIRI-FM

The SIRI-FM updater works slightly differently from the others in that it only updates the availability
of parking but does not create new lots in realtime.

The data source must conform to the [Italian SIRI-FM](https://github.com/5Tsrl/siri-italian-profile) profile
which requires SIRI 2.1.

<!-- INSERT: siri-fm -->

## Changelog

- Create initial sandbox implementation (January 2022, [#3796](https://github.com/opentripplanner/OpenTripPlanner/pull/3796))
Expand Down
2 changes: 2 additions & 0 deletions doc/user/BuildConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ Sections follow that describe particular settings in more depth.
|    [groupFilePattern](#nd_groupFilePattern) | `regexp` | Pattern for matching group NeTEx files. | *Optional* | `"(\w{3})-.*\.xml"` | 2.0 |
|    ignoreFareFrame | `boolean` | Ignore contents of the FareFrame | *Optional* | `false` | 2.3 |
|    [ignoreFilePattern](#nd_ignoreFilePattern) | `regexp` | Pattern for matching ignored files in a NeTEx bundle. | *Optional* | `"$^"` | 2.0 |
|    ignoreParking | `boolean` | Ignore Parking elements. | *Optional* | `true` | 2.6 |
|    noTransfersOnIsolatedStops | `boolean` | Whether we should allow transfers to and from StopPlaces marked with LimitedUse.ISOLATED | *Optional* | `false` | 2.2 |
|    [sharedFilePattern](#nd_sharedFilePattern) | `regexp` | Pattern for matching shared NeTEx files in a NeTEx bundle. | *Optional* | `"shared-data\.xml"` | 2.0 |
|    [sharedGroupFilePattern](#nd_sharedGroupFilePattern) | `regexp` | Pattern for matching shared group NeTEx files in a NeTEx bundle. | *Optional* | `"(\w{3})-.*-shared\.xml"` | 2.0 |
Expand Down Expand Up @@ -106,6 +107,7 @@ Sections follow that describe particular settings in more depth.
|       [groupFilePattern](#tf_1_groupFilePattern) | `regexp` | Pattern for matching group NeTEx files. | *Optional* | `"(\w{3})-.*\.xml"` | 2.0 |
|       ignoreFareFrame | `boolean` | Ignore contents of the FareFrame | *Optional* | `false` | 2.3 |
|       [ignoreFilePattern](#tf_1_ignoreFilePattern) | `regexp` | Pattern for matching ignored files in a NeTEx bundle. | *Optional* | `"$^"` | 2.0 |
|       ignoreParking | `boolean` | Ignore Parking elements. | *Optional* | `true` | 2.6 |
|       noTransfersOnIsolatedStops | `boolean` | Whether we should allow transfers to and from StopPlaces marked with LimitedUse.ISOLATED | *Optional* | `false` | 2.2 |
|       [sharedFilePattern](#tf_1_sharedFilePattern) | `regexp` | Pattern for matching shared NeTEx files in a NeTEx bundle. | *Optional* | `"shared-data\.xml"` | 2.0 |
|       [sharedGroupFilePattern](#tf_1_sharedGroupFilePattern) | `regexp` | Pattern for matching shared group NeTEx files in a NeTEx bundle. | *Optional* | `"(\w{3})-.*-shared\.xml"` | 2.0 |
Expand Down
5 changes: 5 additions & 0 deletions doc/user/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle
- Add debug information for stop/quay ID and stay-seated transfers [#5962](https://github.com/opentripplanner/OpenTripPlanner/pull/5962)
- Handle NeTEx `any` version [#5983](https://github.com/opentripplanner/OpenTripPlanner/pull/5983)
- Keep at least one result for min-transfers and each transit-group in itinerary-group-filter [#5919](https://github.com/opentripplanner/OpenTripPlanner/pull/5919)
- Extract parking lots from NeTEx feeds [#5946](https://github.com/opentripplanner/OpenTripPlanner/pull/5946)
- Filter routes and patterns by service date in GTFS GraphQL API [#5869](https://github.com/opentripplanner/OpenTripPlanner/pull/5869)
- SIRI-FM vehicle parking updates [#5979](https://github.com/opentripplanner/OpenTripPlanner/pull/5979)
- Take realtime patterns into account when storing realtime vehicles [#5994](https://github.com/opentripplanner/OpenTripPlanner/pull/5994)
- Debug client itinerary list style improvements [#6012](https://github.com/opentripplanner/OpenTripPlanner/pull/6012)
[](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE)

## 2.5.0 (2024-03-13)
Expand Down
4 changes: 2 additions & 2 deletions doc/user/RouteRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ This is a performance limit and should therefore be set high. Results close to t
guaranteed to be optimal. Use itinerary-filters to limit what is presented to the client. The
duration can be set per mode(`maxDirectStreetDurationForMode`), because some street modes searches
are much more resource intensive than others. A default value is applied if the mode specific value
do not exist."
does not exist."


<h3 id="rd_maxJourneyDuration">maxJourneyDuration</h3>
Expand Down Expand Up @@ -403,7 +403,7 @@ This is a performance limit and should therefore be set high. Results close to t
guaranteed to be optimal. Use itinerary-filters to limit what is presented to the client. The
duration can be set per mode(`maxDurationForMode`), because some street modes searches
are much more resource intensive than others. A default value is applied if the mode specific value
do not exist.
does not exist.


<h3 id="rd_accessEgress_maxStopCount">maxStopCount</h3>
Expand Down
6 changes: 6 additions & 0 deletions doc/user/RouterConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,12 @@ Used to group requests when monitoring OTP.
"feedId" : "bikeep",
"sourceType" : "bikeep",
"url" : "https://services.bikeep.com/location/v1/public-areas/no-baia-mobility/locations"
},
{
"type" : "vehicle-parking",
"feedId" : "parking",
"sourceType" : "siri-fm",
"url" : "https://transmodel.api.opendatahub.com/siri-lite/fm/parking"
}
],
"rideHailingServices" : [
Expand Down
3 changes: 2 additions & 1 deletion doc/user/examples/entur/build-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
{
"type": "netex",
"source": "gs://${OTP_GCS_BUCKET}/outbound/netex/rb_norway-aggregated-netex-otp2.zip",
"feedId": "EN"
"feedId": "EN",
"ignoreParking": true
}
],
"osm": [
Expand Down
101 changes: 91 additions & 10 deletions doc/user/sandbox/VehicleParking.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ All updaters have the following parameters in common:

The id of the data source, which will be the prefix of the parking lot's id.

This will end up in the API responses as the feed id of of the parking lot.
This will end up in the API responses as the feed id of the parking lot.

<h4 id="u__2__sourceType">sourceType</h4>

**Since version:** `2.2`**Type:** `enum`**Cardinality:** `Required`
**Path:** /updaters/[2]
**Enum values:** `park-api` | `bicycle-park-api` | `hsl-park` | `bikely` | `noi-open-data-hub` | `bikeep`
**Enum values:** `park-api` | `bicycle-park-api` | `hsl-park` | `bikely` | `noi-open-data-hub` | `bikeep` | `siri-fm`

The source of the vehicle updates.

Expand Down Expand Up @@ -125,13 +125,13 @@ Used for converting abstract opening hours into concrete points in time.

The id of the data source, which will be the prefix of the parking lot's id.

This will end up in the API responses as the feed id of of the parking lot.
This will end up in the API responses as the feed id of the parking lot.

<h4 id="u__3__sourceType">sourceType</h4>

**Since version:** `2.2`**Type:** `enum`**Cardinality:** `Required`
**Path:** /updaters/[3]
**Enum values:** `park-api` | `bicycle-park-api` | `hsl-park` | `bikely` | `noi-open-data-hub` | `bikeep`
**Enum values:** `park-api` | `bicycle-park-api` | `hsl-park` | `bikely` | `noi-open-data-hub` | `bikeep` | `siri-fm`

The source of the vehicle updates.

Expand Down Expand Up @@ -210,13 +210,13 @@ Tags to add to the parking lots.

The id of the data source, which will be the prefix of the parking lot's id.

This will end up in the API responses as the feed id of of the parking lot.
This will end up in the API responses as the feed id of the parking lot.

<h4 id="u__4__sourceType">sourceType</h4>

**Since version:** `2.2`**Type:** `enum`**Cardinality:** `Required`
**Path:** /updaters/[4]
**Enum values:** `park-api` | `bicycle-park-api` | `hsl-park` | `bikely` | `noi-open-data-hub` | `bikeep`
**Enum values:** `park-api` | `bicycle-park-api` | `hsl-park` | `bikely` | `noi-open-data-hub` | `bikeep` | `siri-fm`

The source of the vehicle updates.

Expand Down Expand Up @@ -275,13 +275,13 @@ HTTP headers to add to the request. Any header key, value can be inserted.

The id of the data source, which will be the prefix of the parking lot's id.

This will end up in the API responses as the feed id of of the parking lot.
This will end up in the API responses as the feed id of the parking lot.

<h4 id="u__5__sourceType">sourceType</h4>

**Since version:** `2.2`**Type:** `enum`**Cardinality:** `Required`
**Path:** /updaters/[5]
**Enum values:** `park-api` | `bicycle-park-api` | `hsl-park` | `bikely` | `noi-open-data-hub` | `bikeep`
**Enum values:** `park-api` | `bicycle-park-api` | `hsl-park` | `bikely` | `noi-open-data-hub` | `bikeep` | `siri-fm`

The source of the vehicle updates.

Expand Down Expand Up @@ -336,13 +336,13 @@ HTTP headers to add to the request. Any header key, value can be inserted.

The id of the data source, which will be the prefix of the parking lot's id.

This will end up in the API responses as the feed id of of the parking lot.
This will end up in the API responses as the feed id of the parking lot.

<h4 id="u__14__sourceType">sourceType</h4>

**Since version:** `2.2`**Type:** `enum`**Cardinality:** `Required`
**Path:** /updaters/[14]
**Enum values:** `park-api` | `bicycle-park-api` | `hsl-park` | `bikely` | `noi-open-data-hub` | `bikeep`
**Enum values:** `park-api` | `bicycle-park-api` | `hsl-park` | `bikely` | `noi-open-data-hub` | `bikeep` | `siri-fm`

The source of the vehicle updates.

Expand Down Expand Up @@ -373,6 +373,87 @@ HTTP headers to add to the request. Any header key, value can be inserted.

<!-- bikeep END -->

## SIRI-FM

The SIRI-FM updater works slightly differently from the others in that it only updates the availability
of parking but does not create new lots in realtime.

The data source must conform to the [Italian SIRI-FM](https://github.com/5Tsrl/siri-italian-profile) profile
which requires SIRI 2.1.

<!-- siri-fm BEGIN -->
<!-- NOTE! This section is auto-generated. Do not change, change doc in code instead. -->

| Config Parameter | Type | Summary | Req./Opt. | Default Value | Since |
|----------------------------------|:---------------:|------------------------------------------------------------------------------|:----------:|---------------|:-----:|
| type = "vehicle-parking" | `enum` | The type of the updater. | *Required* | | 1.5 |
| [feedId](#u__15__feedId) | `string` | The id of the data source, which will be the prefix of the parking lot's id. | *Required* | | 2.2 |
| frequency | `duration` | How often to update the source. | *Optional* | `"PT1M"` | 2.6 |
| [sourceType](#u__15__sourceType) | `enum` | The source of the vehicle updates. | *Required* | | 2.2 |
| [url](#u__15__url) | `uri` | URL of the SIRI-FM Light endpoint. | *Required* | | 2.6 |
| [headers](#u__15__headers) | `map of string` | HTTP headers to add to the request. Any header key, value can be inserted. | *Optional* | | 2.6 |


#### Details

<h4 id="u__15__feedId">feedId</h4>

**Since version:** `2.2`**Type:** `string`**Cardinality:** `Required`
**Path:** /updaters/[15]

The id of the data source, which will be the prefix of the parking lot's id.

This will end up in the API responses as the feed id of the parking lot.

<h4 id="u__15__sourceType">sourceType</h4>

**Since version:** `2.2`**Type:** `enum`**Cardinality:** `Required`
**Path:** /updaters/[15]
**Enum values:** `park-api` | `bicycle-park-api` | `hsl-park` | `bikely` | `noi-open-data-hub` | `bikeep` | `siri-fm`

The source of the vehicle updates.

<h4 id="u__15__url">url</h4>

**Since version:** `2.6`**Type:** `uri`**Cardinality:** `Required`
**Path:** /updaters/[15]

URL of the SIRI-FM Light endpoint.

SIRI Light means that it must be available as a HTTP GET request rather than the usual
SIRI request mechanism of HTTP POST.

The contents must also conform to the [Italian SIRI profile](https://github.com/5Tsrl/siri-italian-profile)
which requires SIRI 2.1.


<h4 id="u__15__headers">headers</h4>

**Since version:** `2.6`**Type:** `map of string`**Cardinality:** `Optional`
**Path:** /updaters/[15]

HTTP headers to add to the request. Any header key, value can be inserted.



##### Example configuration

```JSON
// router-config.json
{
"updaters" : [
{
"type" : "vehicle-parking",
"feedId" : "parking",
"sourceType" : "siri-fm",
"url" : "https://transmodel.api.opendatahub.com/siri-lite/fm/parking"
}
]
}
```

<!-- siri-fm END -->

## Changelog

- Create initial sandbox implementation (January 2022, [#3796](https://github.com/opentripplanner/OpenTripPlanner/pull/3796))
Expand Down
2 changes: 1 addition & 1 deletion magidoc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ To learn how to deactivate it, read the
'Polyline': '<>',
'GeoJson': '<>',
'OffsetDateTime': '2024-02-05T18:04:23+01:00',
'LocalDate': '2024-05-24',
'Duration': 'PT10M',
'CoordinateValue': 19.24,
'Reluctance': 3.1,
'Speed': 3.4,
'Cost': 100,
'Ratio': 0.25,
'Locale': 'en'

},
}
},
Expand Down
Loading

0 comments on commit 688b7bd

Please sign in to comment.