Skip to content

Commit

Permalink
Merge pull request #5769 from leonardehrenfried/noi-parking
Browse files Browse the repository at this point in the history
Parking updater for NOI Open Data Hub
  • Loading branch information
leonardehrenfried authored Apr 10, 2024
2 parents 146db25 + 95c4f6c commit 39fe08e
Show file tree
Hide file tree
Showing 25 changed files with 537 additions and 109 deletions.
7 changes: 6 additions & 1 deletion doc-templates/VehicleParking.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Contact Info

- For HSL Park and Ride updater: Digitransit team, HSL, Helsinki, Finland
- For Bikely updater: Leonard Ehrenfried, [[email protected]](mailto:[email protected])
- For Bikely and NOI updater: Leonard Ehrenfried, [[email protected]](mailto:[email protected])


## Documentation
Expand All @@ -16,6 +16,7 @@ Currently contains the following updaters:
- [HSL Park and Ride](https://p.hsl.fi/docs/index.html)
- [ParkAPI](https://github.com/offenesdresden/ParkAPI)
- [Bikely](https://www.safebikely.com/)
- [NOI Open Data Hub](https://opendatahub.com/)

### Configuration

Expand All @@ -39,6 +40,10 @@ All updaters have the following parameters in common:

<!-- INSERT: bikely -->

## NOI Open Data Hub

<!-- INSERT: noi-open-data-hub -->


## Changelog

Expand Down
6 changes: 6 additions & 0 deletions docs/RouterConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,12 @@ Used to group requests when monitoring OTP.
"Authorization" : "${BIKELY_AUTHORIZATION}"
}
},
{
"type" : "vehicle-parking",
"feedId" : "noi",
"sourceType" : "noi-open-data-hub",
"url" : "https://parking.otp.opendatahub.com/parking/all.json"
},
{
"type" : "stop-time-updater",
"frequency" : "1m",
Expand Down
36 changes: 18 additions & 18 deletions docs/UpdaterConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,20 @@ The information is downloaded in a single HTTP request and polled regularly.
| Config Parameter | Type | Summary | Req./Opt. | Default Value | Since |
|-----------------------------------------------------------------------|:---------------:|----------------------------------------------------------------------------|:----------:|----------------------|:-----:|
| type = "stop-time-updater" | `enum` | The type of the updater. | *Required* | | 1.5 |
| [backwardsDelayPropagationType](#u__5__backwardsDelayPropagationType) | `enum` | How backwards propagation should be handled. | *Optional* | `"required-no-data"` | 2.2 |
| [backwardsDelayPropagationType](#u__6__backwardsDelayPropagationType) | `enum` | How backwards propagation should be handled. | *Optional* | `"required-no-data"` | 2.2 |
| feedId | `string` | Which feed the updates apply to. | *Required* | | 1.5 |
| frequency | `duration` | How often the data should be downloaded. | *Optional* | `"PT1M"` | 1.5 |
| fuzzyTripMatching | `boolean` | If the trips should be matched fuzzily. | *Optional* | `false` | 1.5 |
| [url](#u__5__url) | `string` | The URL of the GTFS-RT resource. | *Required* | | 1.5 |
| [headers](#u__5__headers) | `map of string` | HTTP headers to add to the request. Any header key, value can be inserted. | *Optional* | | 2.3 |
| [url](#u__6__url) | `string` | The URL of the GTFS-RT resource. | *Required* | | 1.5 |
| [headers](#u__6__headers) | `map of string` | HTTP headers to add to the request. Any header key, value can be inserted. | *Optional* | | 2.3 |


##### Parameter details

<h4 id="u__5__backwardsDelayPropagationType">backwardsDelayPropagationType</h4>
<h4 id="u__6__backwardsDelayPropagationType">backwardsDelayPropagationType</h4>

**Since version:** `2.2`**Type:** `enum`**Cardinality:** `Optional`**Default value:** `"required-no-data"`
**Path:** /updaters/[5]
**Path:** /updaters/[6]
**Enum values:** `required-no-data` | `required` | `always`

How backwards propagation should be handled.
Expand All @@ -124,19 +124,19 @@ How backwards propagation should be handled.
The updated times are exposed through APIs.


<h4 id="u__5__url">url</h4>
<h4 id="u__6__url">url</h4>

**Since version:** `1.5`**Type:** `string`**Cardinality:** `Required`
**Path:** /updaters/[5]
**Path:** /updaters/[6]

The URL of the GTFS-RT resource.

`file:` URLs are also supported if you want to read a file from the local disk.

<h4 id="u__5__headers">headers</h4>
<h4 id="u__6__headers">headers</h4>

**Since version:** `2.3`**Type:** `map of string`**Cardinality:** `Optional`
**Path:** /updaters/[5]
**Path:** /updaters/[6]

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

Expand Down Expand Up @@ -178,7 +178,7 @@ This system powers the realtime updates in Helsinki and more information can be
| Config Parameter | Type | Summary | Req./Opt. | Default Value | Since |
|-----------------------------------------------------------------------|:---------:|----------------------------------------------|:----------:|----------------------|:-----:|
| type = "mqtt-gtfs-rt-updater" | `enum` | The type of the updater. | *Required* | | 1.5 |
| [backwardsDelayPropagationType](#u__6__backwardsDelayPropagationType) | `enum` | How backwards propagation should be handled. | *Optional* | `"required-no-data"` | 2.2 |
| [backwardsDelayPropagationType](#u__7__backwardsDelayPropagationType) | `enum` | How backwards propagation should be handled. | *Optional* | `"required-no-data"` | 2.2 |
| feedId | `string` | The feed id to apply the updates to. | *Required* | | 2.0 |
| fuzzyTripMatching | `boolean` | Whether to match trips fuzzily. | *Optional* | `false` | 2.0 |
| qos | `integer` | QOS level. | *Optional* | `0` | 2.0 |
Expand All @@ -188,10 +188,10 @@ This system powers the realtime updates in Helsinki and more information can be

##### Parameter details

<h4 id="u__6__backwardsDelayPropagationType">backwardsDelayPropagationType</h4>
<h4 id="u__7__backwardsDelayPropagationType">backwardsDelayPropagationType</h4>

**Since version:** `2.2`**Type:** `enum`**Cardinality:** `Optional`**Default value:** `"required-no-data"`
**Path:** /updaters/[6]
**Path:** /updaters/[7]
**Enum values:** `required-no-data` | `required` | `always`

How backwards propagation should be handled.
Expand Down Expand Up @@ -247,24 +247,24 @@ The information is downloaded in a single HTTP request and polled regularly.
| frequency | `duration` | How often the positions should be updated. | *Optional* | `"PT1M"` | 2.2 |
| fuzzyTripMatching | `boolean` | Whether to match trips fuzzily. | *Optional* | `false` | 2.5 |
| url | `uri` | The URL of GTFS-RT protobuf HTTP resource to download the positions from. | *Required* | | 2.2 |
| [features](#u__7__features) | `enum set` | Which features of GTFS RT vehicle positions should be loaded into OTP. | *Optional* | | 2.5 |
| [headers](#u__7__headers) | `map of string` | HTTP headers to add to the request. Any header key, value can be inserted. | *Optional* | | 2.3 |
| [features](#u__8__features) | `enum set` | Which features of GTFS RT vehicle positions should be loaded into OTP. | *Optional* | | 2.5 |
| [headers](#u__8__headers) | `map of string` | HTTP headers to add to the request. Any header key, value can be inserted. | *Optional* | | 2.3 |


##### Parameter details

<h4 id="u__7__features">features</h4>
<h4 id="u__8__features">features</h4>

**Since version:** `2.5`**Type:** `enum set`**Cardinality:** `Optional`
**Path:** /updaters/[7]
**Path:** /updaters/[8]
**Enum values:** `position` | `stop-position` | `occupancy`

Which features of GTFS RT vehicle positions should be loaded into OTP.

<h4 id="u__7__headers">headers</h4>
<h4 id="u__8__headers">headers</h4>

**Since version:** `2.3`**Type:** `map of string`**Cardinality:** `Optional`
**Path:** /updaters/[7]
**Path:** /updaters/[8]

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

Expand Down
74 changes: 68 additions & 6 deletions docs/sandbox/VehicleParking.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Contact Info

- For HSL Park and Ride updater: Digitransit team, HSL, Helsinki, Finland
- For Bikely updater: Leonard Ehrenfried, [[email protected]](mailto:[email protected])
- For Bikely and NOI updater: Leonard Ehrenfried, [[email protected]](mailto:[email protected])


## Documentation
Expand All @@ -16,6 +16,7 @@ Currently contains the following updaters:
- [HSL Park and Ride](https://p.hsl.fi/docs/index.html)
- [ParkAPI](https://github.com/offenesdresden/ParkAPI)
- [Bikely](https://www.safebikely.com/)
- [NOI Open Data Hub](https://opendatahub.com/)

### Configuration

Expand Down Expand Up @@ -60,7 +61,7 @@ This will end up in the API responses as the feed id of of the parking lot.

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

The source of the vehicle updates.

Expand Down Expand Up @@ -110,7 +111,7 @@ Used for converting abstract opening hours into concrete points in time.
| frequency | `duration` | How often to update the source. | *Optional* | `"PT1M"` | 2.2 |
| [sourceType](#u__3__sourceType) | `enum` | The source of the vehicle updates. | *Required* | | 2.2 |
| [timeZone](#u__3__timeZone) | `time-zone` | The time zone of the feed. | *Optional* | | 2.2 |
| url | `string` | URL of the resource. | *Optional* | | 2.2 |
| url | `string` | URL of the resource. | *Required* | | 2.2 |
| [headers](#u__3__headers) | `map of string` | HTTP headers to add to the request. Any header key, value can be inserted. | *Optional* | | 2.2 |
| [tags](#u__3__tags) | `string[]` | Tags to add to the parking lots. | *Optional* | | 2.2 |

Expand All @@ -130,7 +131,7 @@ This will end up in the API responses as the feed id of of the parking lot.

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

The source of the vehicle updates.

Expand Down Expand Up @@ -196,7 +197,7 @@ Tags to add to the parking lots.
| [feedId](#u__4__feedId) | `string` | The name of the data source. | *Required* | | 2.2 |
| frequency | `duration` | How often to update the source. | *Optional* | `"PT1M"` | 2.3 |
| [sourceType](#u__4__sourceType) | `enum` | The source of the vehicle updates. | *Required* | | 2.2 |
| url | `uri` | URL of the locations endpoint. | *Optional* | | 2.3 |
| url | `uri` | URL of the locations endpoint. | *Required* | | 2.3 |
| [headers](#u__4__headers) | `map of string` | HTTP headers to add to the request. Any header key, value can be inserted. | *Optional* | | 2.3 |


Expand All @@ -215,7 +216,7 @@ This will end up in the API responses as the feed id of of the parking lot.

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

The source of the vehicle updates.

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

<!-- bikely END -->

## NOI Open Data Hub

<!-- noi-open-data-hub 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__5__feedId) | `string` | The name of the data source. | *Required* | | 2.2 |
| frequency | `duration` | How often to update the source. | *Optional* | `"PT1M"` | 2.6 |
| [sourceType](#u__5__sourceType) | `enum` | The source of the vehicle updates. | *Required* | | 2.2 |
| url | `uri` | URL of the locations endpoint. | *Required* | | 2.6 |
| [headers](#u__5__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__5__feedId">feedId</h4>

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

The name of the data source.

This will end up in the API responses as the feed id of 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`

The source of the vehicle updates.

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

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

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" : "noi",
"sourceType" : "noi-open-data-hub",
"url" : "https://parking.otp.opendatahub.com/parking/all.json"
}
]
}
```

<!-- noi-open-data-hub END -->


## Changelog

Expand Down
Loading

0 comments on commit 39fe08e

Please sign in to comment.