Skip to content

Commit bfc479f

Browse files
Merge remote-tracking branch 'upstream/dev-2.x' into geocoder-agency
2 parents a0e40e3 + 6980767 commit bfc479f

File tree

116 files changed

+2325
-1685
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+2325
-1685
lines changed

.github/workflows/cibuild.yml

+14-14
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ jobs:
2020
timeout-minutes: 20
2121
steps:
2222
# Starting in v2.2 checkout action fetches all tags when fetch-depth=0, for auto-versioning.
23-
- uses: actions/checkout@v3.3.0
23+
- uses: actions/checkout@v4
2424
with:
2525
fetch-depth: 0
2626

2727
# nodejs is needed because the dynamic download of it via the prettier maven plugin often
2828
# times out
2929
# Example: https://github.com/opentripplanner/OpenTripPlanner/actions/runs/4490450225/jobs/7897533439
30-
- uses: actions/setup-node@v3
30+
- uses: actions/setup-node@v4
3131
with:
3232
node-version: 18
3333

3434
# Java setup step completes very fast, no need to run in a preconfigured docker container
3535
- name: Set up JDK 21
36-
uses: actions/setup-java@v3
36+
uses: actions/setup-java@v4
3737
with:
3838
java-version: 21
3939
distribution: temurin
@@ -65,9 +65,9 @@ jobs:
6565
timeout-minutes: 20
6666
runs-on: windows-latest
6767
steps:
68-
- uses: actions/checkout@v3
68+
- uses: actions/checkout@v4
6969
- name: Set up JDK 21
70-
uses: actions/setup-java@v3
70+
uses: actions/setup-java@v4
7171
with:
7272
java-version: 21
7373
distribution: temurin
@@ -91,7 +91,7 @@ jobs:
9191

9292
steps:
9393

94-
- uses: actions/checkout@v3.3.0
94+
- uses: actions/checkout@v4
9595
# this is necessary so that the correct credentials are put into the git configuration
9696
# when we push to dev-2.x and push the HTML to the git repo
9797
if: github.event_name == 'push' && (github.ref == 'refs/heads/dev-2.x' || github.ref == 'refs/heads/master')
@@ -101,7 +101,7 @@ jobs:
101101
# was modified last
102102
fetch-depth: 1000
103103

104-
- uses: actions/checkout@v3.3.0
104+
- uses: actions/checkout@v4
105105
# for a simple PR where we don't push, we don't need any credentials
106106
if: github.event_name == 'pull_request'
107107

@@ -113,7 +113,7 @@ jobs:
113113
if: github.event_name == 'pull_request'
114114
run: mkdocs build
115115

116-
- uses: actions/setup-node@v3
116+
- uses: actions/setup-node@v4
117117
with:
118118
node-version: 18
119119

@@ -174,8 +174,8 @@ jobs:
174174
if: github.repository_owner == 'opentripplanner'
175175
runs-on: ubuntu-latest
176176
steps:
177-
- uses: actions/checkout@v3.1.0
178-
- uses: actions/setup-node@v3
177+
- uses: actions/checkout@v4
178+
- uses: actions/setup-node@v4
179179
with:
180180
node-version: 16
181181
- name: Run code generator
@@ -184,7 +184,7 @@ jobs:
184184
yarn install
185185
yarn generate
186186
- name: Set up JDK 21
187-
uses: actions/setup-java@v3
187+
uses: actions/setup-java@v4
188188
with:
189189
java-version: 21
190190
distribution: temurin
@@ -199,16 +199,16 @@ jobs:
199199
- build-windows
200200
- build-linux
201201
steps:
202-
- uses: actions/checkout@v3.1.0
202+
- uses: actions/checkout@v4
203203
with:
204204
fetch-depth: 0
205205
- name: Set up JDK 21
206-
uses: actions/setup-java@v3
206+
uses: actions/setup-java@v4
207207
with:
208208
java-version: 21
209209
distribution: temurin
210210
cache: maven
211-
- uses: actions/setup-node@v3
211+
- uses: actions/setup-node@v4
212212
with:
213213
node-version: 18
214214
- name: Build container image with Jib, push to Dockerhub

.github/workflows/debug-client.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- uses: actions/checkout@v4
3131
if: github.event_name == 'pull_request'
3232

33-
- uses: actions/setup-node@v3
33+
- uses: actions/setup-node@v4
3434
with:
3535
node-version: 18
3636

.github/workflows/performance-test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ jobs:
6060
profile: extended
6161

6262
steps:
63-
- uses: actions/checkout@v3.1.0
63+
- uses: actions/checkout@v4
6464
if: matrix.profile == 'core' || github.ref == 'refs/heads/dev-2.x'
6565
with:
6666
fetch-depth: 0
6767

6868
- name: Set up JDK
6969
if: matrix.profile == 'core' || github.ref == 'refs/heads/dev-2.x'
70-
uses: actions/setup-java@v3
70+
uses: actions/setup-java@v4
7171
with:
7272
java-version: 21
7373
distribution: temurin

.github/workflows/post-merge.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717

1818
- name: Checkout
19-
uses: actions/checkout@v3.1.0
19+
uses: actions/checkout@v4
2020
with:
2121
token: ${{ secrets.CHANGELOG_TOKEN }}
2222

@@ -62,7 +62,7 @@ jobs:
6262
git config --global user.email 'serialization-version-bot@opentripplanner.org'
6363
6464
- name: Checkout
65-
uses: actions/checkout@v3.1.0
65+
uses: actions/checkout@v4
6666
with:
6767
token: ${{ secrets.CHANGELOG_TOKEN }}
6868

client-next/src/components/MapView/MapView.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export function MapView({
7575
}}
7676
// it's unfortunate that you have to list these layers here.
7777
// maybe there is a way around it: https://github.com/visgl/react-map-gl/discussions/2343
78-
interactiveLayerIds={['regular-stop', 'vertex', 'edge', 'link']}
78+
interactiveLayerIds={['regular-stop', 'area-stop', 'vertex', 'edge', 'link']}
7979
onClick={showFeaturePropPopup}
8080
// put lat/long in URL and pan to it on page reload
8181
hash={true}

doc-templates/Configuration.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ you can run the following bash command:
128128
- `head -c 29 Graph.obj ==> OpenTripPlannerGraph;0000007;` (file header)
129129
- `head -c 28 Graph.obj | tail -c 7 ==> 0000007` (version id)
130130

131-
The Maven _pom.xml_, the _META-INF/MANIFEST.MF_, the OTP command line(`--serVerId`), log start-up
132-
messages and all OTP APIs can be used to get the OTP Serialization Version Id.
131+
The Maven _pom.xml_, the _META-INF/MANIFEST.MF_, the OTP command line(`--serializationVersionId`),
132+
log start-up messages and all OTP APIs can be used to get the OTP Serialization Version Id.
133133

134134
## Include file directive
135135

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
# Mapbox Vector Tiles API
2+
3+
## Contact Info
4+
5+
- HSL, Finland
6+
- Arcadis, US
7+
8+
## Documentation
9+
10+
This API produces [Mapbox vector tiles](https://docs.mapbox.com/vector-tiles/reference/), which are
11+
used by [Digitransit-ui](https://github.com/HSLdevcom/digitransit-ui) and
12+
[`otp-react-redux`](https://github.com/opentripplanner/otp-react-redux) to show information about
13+
public transit entities on the map.
14+
15+
The tiles can be fetched from `/otp/routers/{routerId}/vectorTiles/{layers}/{z}/{x}/{y}.pbf`,
16+
where `layers` is a comma separated list of layer names from the configuration.
17+
18+
Maplibre/Mapbox GL JS also requires a tilejson.json endpoint which is available at
19+
`/otp/routers/{routerId}/vectorTiles/{layers}/tilejson.json`.
20+
21+
Translatable fields in the tiles are translated based on the `accept-language` header in requests.
22+
Currently, only the language with the highest priority from the header is used.
23+
24+
### Configuration
25+
26+
To enable this you need to add the feature `otp-config.json`.
27+
28+
```json
29+
// otp-config.json
30+
{
31+
"otpFeatures": {
32+
"SandboxAPIMapboxVectorTilesApi": true
33+
}
34+
}
35+
```
36+
37+
The feature must be configured in `router-config.json` as follows
38+
39+
```JSON
40+
{
41+
"vectorTiles": {
42+
"basePath": "/only/configure/if/required",
43+
"layers": [
44+
{
45+
"name": "stops",
46+
"type": "Stop",
47+
"mapper": "Digitransit",
48+
"maxZoom": 20,
49+
"minZoom": 14,
50+
"cacheMaxSeconds": 600
51+
},
52+
{
53+
"name": "stations",
54+
"type": "Station",
55+
"mapper": "Digitransit",
56+
"maxZoom": 20,
57+
"minZoom": 12,
58+
"cacheMaxSeconds": 600
59+
},
60+
// all rental places: stations and free-floating vehicles
61+
{
62+
"name": "citybikes",
63+
"type": "VehicleRental",
64+
"mapper": "Digitransit",
65+
"maxZoom": 20,
66+
"minZoom": 14,
67+
"cacheMaxSeconds": 60,
68+
"expansionFactor": 0.25
69+
},
70+
// just free-floating vehicles
71+
{
72+
"name": "rentalVehicles",
73+
"type": "VehicleRentalVehicle",
74+
"mapper": "DigitransitRealtime",
75+
"maxZoom": 20,
76+
"minZoom": 14,
77+
"cacheMaxSeconds": 60
78+
},
79+
// just rental stations
80+
{
81+
"name": "rentalStations",
82+
"type": "VehicleRentalStation",
83+
"mapper": "Digitransit",
84+
"maxZoom": 20,
85+
"minZoom": 14,
86+
"cacheMaxSeconds": 600
87+
},
88+
// Contains just stations and real-time information for them
89+
{
90+
"name": "realtimeRentalStations",
91+
"type": "VehicleRentalStation",
92+
"mapper": "DigitransitRealtime",
93+
"maxZoom": 20,
94+
"minZoom": 14,
95+
"cacheMaxSeconds": 60
96+
},
97+
// This exists for backwards compatibility. At some point, we might want
98+
// to add a new real-time parking mapper with better translation support
99+
// and less unnecessary fields.
100+
{
101+
"name": "stadtnaviVehicleParking",
102+
"type": "VehicleParking",
103+
"mapper": "Stadtnavi",
104+
"maxZoom": 20,
105+
"minZoom": 14,
106+
"cacheMaxSeconds": 60,
107+
"expansionFactor": 0.25
108+
},
109+
// no real-time, translatable fields are translated based on accept-language header
110+
// and contains less fields than the Stadtnavi mapper
111+
{
112+
"name": "vehicleParking",
113+
"type": "VehicleParking",
114+
"mapper": "Digitransit",
115+
"maxZoom": 20,
116+
"minZoom": 14,
117+
"cacheMaxSeconds": 600,
118+
"expansionFactor": 0.25
119+
},
120+
{
121+
"name": "vehicleParkingGroups",
122+
"type": "VehicleParkingGroup",
123+
"mapper": "Digitransit",
124+
"maxZoom": 17,
125+
"minZoom": 14,
126+
"cacheMaxSeconds": 600,
127+
"expansionFactor": 0.25
128+
}
129+
]
130+
}
131+
}
132+
```
133+
134+
For each layer, the configuration includes:
135+
136+
- `name` which is used in the url to fetch tiles, and as the layer name in the vector tiles.
137+
- `type` which tells the type of the layer. Currently supported:
138+
- `Stop`
139+
- `Station`
140+
- `VehicleRental`: all rental places: stations and free-floating vehicles
141+
- `VehicleRentalVehicle`: free-floating rental vehicles
142+
- `VehicleRentalStation`: rental stations
143+
- `VehicleParking`
144+
- `VehicleParkingGroup`
145+
146+
<!-- INSERT: parameters -->
147+
148+
### Extending
149+
150+
If more generic layers are created for this API, the code should be moved out from the sandbox, into
151+
the core, perhaps potentially leaving specific property mappers in place.
152+
153+
#### Creating a new layer
154+
155+
In order to create a new type of layer, you need to create a new class extending `LayerBuilder<T>`.
156+
You need to implement two methods, `List<Geometry> getGeometries(Envelope query)`, which returns a
157+
list of geometries, with an object of type `T` as their userData in the geometry,
158+
and `double getExpansionFactor()`, which describes how much information outside the tile bounds
159+
should be included. This layer then needs to be added into `VectorTilesResource.layers`, with a
160+
new `LayerType` enum as the key, and the class constructor as the value.
161+
162+
A new mapper needs to be added every time a new layer is added. See below for information.
163+
164+
#### Creating a new mapper
165+
166+
The mapping contains information of what data to include in the vector tiles. The mappers are
167+
defined per layer.
168+
169+
In order to create a new mapper for a layer, you need to create a new class
170+
extending `PropertyMapper<T>`. In that class, you need to implement the
171+
method `Collection<KeyValue<String, Object>> map(T input)`. The type T is dependent on the layer for which
172+
you implement the mapper for. It needs to return a list of attributes, as key-value pairs which will
173+
be written into the vector tile.
174+
175+
The mapper needs to be added to the `mappers` map in the layer, with a new `MapperType` enum as the
176+
key, and a function to create the mapper, with a `Graph` object as a parameter, as the value.
177+
178+
## Changelog
179+
180+
- 2020-07-09: Initial version of Mapbox vector tiles API
181+
- 2021-05-12: Make expansion factor configurable
182+
- 2021-09-07: Rename `BikeRental` to `VehicleRental`
183+
- 2021-10-13: Correctly serialize the vehicle rental name [#3648](https://github.com/opentripplanner/OpenTripPlanner/pull/3648)
184+
- 2022-01-03: Add support for VehicleParking entities
185+
- 2022-04-27: Read the headsign for frequency-only patterns correctly [#4122](https://github.com/opentripplanner/OpenTripPlanner/pull/4122)
186+
- 2022-08-23: Remove patterns and add route gtfsTypes to stop layer [#4404](https://github.com/opentripplanner/OpenTripPlanner/pull/4404)
187+
- 2022-10-11: Added layer for VehicleParkingGroups [#4510](https://github.com/opentripplanner/OpenTripPlanner/pull/4510)
188+
- 2022-10-14: Add separate layers for vehicle rental place types [#4516](https://github.com/opentripplanner/OpenTripPlanner/pull/4516)
189+
- 2022-10-19 [#4529](https://github.com/opentripplanner/OpenTripPlanner/pull/4529):
190+
* Translatable fields are now translated based on accept-language header
191+
* Added DigitransitRealtime for vehicle rental stations
192+
* Changed old vehicle parking mapper to be Stadtnavi
193+
* Added a new Digitransit vehicle parking mapper with no real-time information and less fields
194+
- 2024-01-22: Make `basePath` configurable [#5627](https://github.com/opentripplanner/OpenTripPlanner/pull/5627)

docs/Changelog.md

+6
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle
7878
- Add new path for GTFS GraphQL API, remove batch feature [#5581](https://github.com/opentripplanner/OpenTripPlanner/pull/5581)
7979
- Restructure walk/bicycle/car preferences in router-config.json [#5582](https://github.com/opentripplanner/OpenTripPlanner/pull/5582)
8080
- Revert REST API spelling change of real-time [#5629](https://github.com/opentripplanner/OpenTripPlanner/pull/5629)
81+
- Remove `FareComponent` [#5613](https://github.com/opentripplanner/OpenTripPlanner/pull/5613)
82+
- Add AreaStop layer to new debug frontend [#5636](https://github.com/opentripplanner/OpenTripPlanner/pull/5636)
83+
- Allow configuration of vector tiles base path [#5627](https://github.com/opentripplanner/OpenTripPlanner/pull/5627)
84+
- Change Transmodel API path to `/otp/transmodel/v3` [#5637](https://github.com/opentripplanner/OpenTripPlanner/pull/5637)
85+
- Add flexibleArea to GroupStop Quays [#5625](https://github.com/opentripplanner/OpenTripPlanner/pull/5625)
86+
- Pass-through should override transit-group-priority [#5638](https://github.com/opentripplanner/OpenTripPlanner/pull/5638)
8187
[](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE)
8288

8389
## 2.4.0 (2023-09-13)

docs/Configuration.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ you can run the following bash command:
155155
- `head -c 29 Graph.obj ==> OpenTripPlannerGraph;0000007;` (file header)
156156
- `head -c 28 Graph.obj | tail -c 7 ==> 0000007` (version id)
157157

158-
The Maven _pom.xml_, the _META-INF/MANIFEST.MF_, the OTP command line(`--serVerId`), log start-up
159-
messages and all OTP APIs can be used to get the OTP Serialization Version Id.
158+
The Maven _pom.xml_, the _META-INF/MANIFEST.MF_, the OTP command line(`--serializationVersionId`),
159+
log start-up messages and all OTP APIs can be used to get the OTP Serialization Version Id.
160160

161161
## Include file directive
162162

0 commit comments

Comments
 (0)