Skip to content

Commit d2fb262

Browse files
committed
Add vehicle status, remove routes
1 parent 49a2c80 commit d2fb262

3 files changed

Lines changed: 93 additions & 59 deletions

File tree

agency/README.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This specification contains a collection of RESTful APIs used to specify the dig
1515
* [Authorization](#authorization)
1616
* [GBFS](#gbfs)
1717
* [Vehicles](#vehicles)
18+
* [Vehicle - Status](#vehicle---status)
1819
* [Vehicle - Register](#vehicle---register)
1920
* [Vehicle - Update](#vehicle---update)
2021
* [Trips](#trips)
@@ -67,7 +68,7 @@ See the [GBFS Requirement](/README.md#gbfs-requirement) language for more detail
6768

6869
## Vehicles
6970

70-
The `/vehicles` endpoint returns the specified vehicle (if a device_id is provided) or a list of known vehicles. Providers can only retrieve data for vehicles in their registered fleet.
71+
The `/vehicles` endpoint returns the specified vehicle (if a device_id is provided) or a list of known vehicles. Providers can only retrieve data for vehicles in their registered fleet. Contains vehicle properties that do not change often.
7172

7273
Endpoint: `/vehicles/{device_id}`
7374
Method: `GET`
@@ -100,6 +101,41 @@ _No content returned on vehicle not found._
100101

101102
[Top][toc]
102103

104+
### Vehicle - Status
105+
106+
The `/vehicles/status` endpoint returns information about the specified vehicle (if a device_id is provided) or a list of known vehicles current state. Providers can only retrieve data for vehicles in their registered fleet. Contains specific vehicle properties that are updated frequently.
107+
108+
Endpoint: `/vehicles/status/{device_id}`
109+
Method: `GET`
110+
111+
Path Params:
112+
113+
| Param | Type | Required/Optional | Description |
114+
| ------------ | ---- | ----------------- | ------------------------------------------- |
115+
| `device_id` | UUID | Optional | If provided, retrieve the specified vehicle |
116+
117+
200 Success Response:
118+
119+
If `device_id` is specified, `GET` will return an array with a single vehicle record, otherwise it will be a list of vehicle records with pagination details per the [JSON API](https://jsonapi.org/format/#fetching-pagination) spec:
120+
121+
```json
122+
{
123+
"vehicles": [ ... ]
124+
"links": {
125+
"first": "https://...",
126+
"last": "https://...",
127+
"prev": "https://...",
128+
"next": "https://..."
129+
}
130+
}
131+
```
132+
133+
404 Failure Response:
134+
135+
_No content returned on vehicle not found._
136+
137+
[Top][toc]
138+
103139
### Vehicle - Register
104140

105141
The `/vehicles` registration endpoint is used to register vehicles for use in the Agency's jurisdiction.
@@ -296,7 +332,7 @@ The authenticated reports are monthly, historic flat files that may be pre-gener
296332

297333
[Top][toc]
298334

299-
## Reports - register
335+
## Reports - Register
300336

301337
The `/reports` endpoint allows an agency to register aggregated report counts in CSV structure.
302338

data-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ A standard point of vehicle telemetry. References to latitude and longitude impl
142142

143143
## Stops
144144

145-
Stops describe vehicle trip start and end locations in a pre-designated physical place. They can vary from docking stations with or without charging, corrals with lock-to railings, or suggested parking areas marked with spray paint. Stops are used in both [Provider](/provider#stops) (including routes and event locations) and [Agency](/agency#stops) (including telemetry data).
145+
Stops describe vehicle trip start and end locations in a pre-designated physical place. They can vary from docking stations with or without charging, corrals with lock-to railings, or suggested parking areas marked with spray paint. Stops are used in both [Provider](/provider#stops) and [Agency](/agency#stops) telemetry data.
146146

147147
| Field | Type | Required/Optional | Description |
148148
| ----- | ---- |-------------------|-------------|

provider/README.md

Lines changed: 54 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ This specification contains a data standard for *mobility as a service* provider
1919
* [Municipality Boundary](#municipality-boundary)
2020
* [Other Data Types](#other-data-types)
2121
* [Vehicles](#vehicles)
22+
* [Vehicle Status](#vehicle-status)
2223
* [Trips](#trips)
2324
* [Trips - Query Parameters](#trips---query-parameters)
2425
* [Trips - Responses](#trips---responses)
25-
* [Routes](#routes)
2626
* [Telemetry](#telemetry)
2727
* [Telemetry - Query Parameters](#telemetry---query-parameters)
2828
* [Events](#events)
@@ -178,7 +178,7 @@ In addition to the standard [Provider payload wrapper](#response-format), respon
178178
}
179179
```
180180

181-
The `/vehicles` endpoint returns the specified vehicle (if a device_id is provided) or a list of known vehicles.
181+
The `/vehicles` endpoint returns the specified vehicle (if a device_id is provided) or a list of known vehicles. Contains vehicle properties that do not change often.
182182

183183
**Endpoint:** `/vehicles/{device_id}`
184184
**Method:** `GET`
@@ -214,10 +214,47 @@ _No content returned on vehicle not found._
214214

215215
[Top][toc]
216216

217+
### Vehicle Status
218+
219+
The `/vehicles/status` endpoint returns the specified vehicle (if a device_id is provided) or a list of known vehicles. Contains specific vehicle properties that are updated frequently.
220+
221+
**Endpoint:** `/vehicles/status/{device_id}`
222+
**Method:** `GET`
223+
**[Beta feature][beta]:** No (as of 1.2.0)
224+
**Schema:** [`vehicles-status` schema][vehicles-status-schema]
225+
**`data` Payload:** `{ "vehicles": [] }`, an array of [Vehicle Status](vehicle-status) objects
226+
227+
Path Params:
228+
229+
| Param | Type | Required/Optional | Description |
230+
| ------------ | ---- | ----------------- | ------------------------------------------- |
231+
| `device_id` | UUID | Optional | If provided, retrieve the specified vehicle |
232+
233+
200 Success Response:
234+
235+
If `device_id` is specified, `GET` will return an array with a single vehicle record, otherwise it will be a list of vehicle records with pagination details per the [JSON API](https://jsonapi.org/format/#fetching-pagination) spec:
236+
237+
```json
238+
{
239+
"vehicles": [ ... ]
240+
"links": {
241+
"first": "https://...",
242+
"last": "https://...",
243+
"prev": "https://...",
244+
"next": "https://..."
245+
}
246+
}
247+
```
248+
249+
404 Failure Response:
250+
251+
_No content returned on vehicle not found._
252+
253+
[Top][toc]
254+
217255
## Trips
218256

219-
A [trip][trips-general-info] represents a journey taken by a *mobility as a service* customer with
220-
a geo-tagged start and stop point.
257+
A [trip][trips-general-info] represents a journey taken by a *mobility as a service* customer with a geo-tagged start and stop point.
221258

222259
The trips endpoint allows a user to query historical trip data.
223260

@@ -271,55 +308,15 @@ For the near-ish real time use cases, please use the [events][events] endpoint.
271308

272309
[Top][toc]
273310

274-
### Routes
275-
276-
To represent a route, MDS `provider` APIs must create a GeoJSON [`FeatureCollection`][geojson-feature-collection], which includes every [observed point][point-geo] in the route, even those which occur outside the [municipality boundary][muni-boundary].
277-
278-
Routes must include at least 2 points: the start point and end point. Routes must include all possible GPS or GNSS samples collected by a Provider. Providers may round the latitude and longitude to the level of precision representing the maximum accuracy of the specific measurement. For example, [a-GPS][agps] is accurate to 5 decimal places, [differential GPS][dgps] is generally accurate to 6 decimal places. Providers may round those readings to the appropriate number for their systems.
279-
280-
Trips that start or end at a [Stop][stops] must include a `stop_id` property in the first (when starting) and last (when ending) Feature of the `route`. See [Stop-based Geographic Data][stop-based-geo] for more information.
311+
## Telemetry
281312

282-
```js
283-
"route": {
284-
"type": "FeatureCollection",
285-
"features": [{
286-
"type": "Feature",
287-
"properties": {
288-
"timestamp": 1529968782421,
289-
// Required for Trips starting at a Stop
290-
"stop_id": "95084833-6a3f-4770-9919-de1ab4b8989b",
291-
},
292-
"geometry": {
293-
"type": "Point",
294-
"coordinates": [
295-
-118.46710503101347,
296-
33.9909333514159
297-
]
298-
}
299-
},
300-
{
301-
"type": "Feature",
302-
"properties": {
303-
"timestamp": 1531007628377,
304-
// Required for Trips ending at a Stop
305-
"stop_id": "b813cde2-a41c-4ae3-b409-72ff221e003d"
306-
},
307-
"geometry": {
308-
"type": "Point",
309-
"coordinates": [
310-
-118.464851975441,
311-
33.990366257735
312-
]
313-
}
314-
}]
315-
}
316-
```
313+
The `/telemetry` endpoint is a feed of vehicle telemetry data for publishing all available location data. For privacy reasons, in-trip telemetry may be delayed at the discretion of the regulating body.
317314

318-
[Top][toc]
315+
To represent trip telemetry, the data should includes every [observed point][point-geo] in the trip, even those which occur outside the [municipality boundary][muni-boundary].
319316

320-
## Telemetry
317+
Trip telemetry must include at least 2 points: the start point and end point. Trips must include all possible GPS or GNSS samples collected by a Provider. Providers may round the latitude and longitude to the level of precision representing the maximum accuracy of the specific measurement. For example, [a-GPS][agps] is accurate to 5 decimal places, [differential GPS][dgps] is generally accurate to 6 decimal places. Providers may round those readings to the appropriate number for their systems.
321318

322-
The `/telemetry` endpoint is a feed of vehicle telemetry data for publishing all available location data. For privacy reasons, in-trip telemetry may be delayed at the discretion of the regulating body.
319+
Trips that start or end at a [Stop][stops] must include a `stop_id` property in the first (when starting) and last (when ending) Feature of the `route`. See [Stop-based Geographic Data][stop-based-geo] for more information.
323320

324321
Unless stated otherwise by the municipality, this endpoint must return only those telemetry that [intersects][intersection] with the [municipality boundary][muni-boundary].
325322

@@ -481,7 +478,7 @@ See [Provider examples](examples.md#reports).
481478
[data-latency]: #data-latency-requirements
482479
[dgps]: https://en.wikipedia.org/wiki/Differential_GPS
483480
[error-messages]: /general-information.md#error-messages
484-
[events]: #events
481+
[events]: /data-types.md#events
485482
[events---query-parameters]: #events---query-parameters
486483
[events-schema]: events.json
487484
[event-times]: #event-times
@@ -499,20 +496,21 @@ See [Provider examples](examples.md#reports).
499496
[point-geo]: /general-information.md#geographic-telemetry-data
500497
[propulsion-types]: /general-information.md#propulsion-types
501498
[responses]: /general-information.md#responses
502-
[stops]: /general-information.md#stops
499+
[stops]: /data-types.md#stops
503500
[stop-based-geo]: /general-information.md#stop-based-geographic-data
504501
[stops-schema]: stops.json
505-
[telemetry]: #telemetry
502+
[telemetry]: /data-types.md#telemetry
506503
[telemetry-schema]: telemetry.json
507504
[telemetry---query-parameters]: #telemetry-query-parameters
508505
[toc]: #table-of-contents
509-
[trips]: /general-information.md#trips
506+
[trips]: /data-types.md#trips
510507
[trips-general-info]: /general-information.md#stop-based-geographic-data
511508
[trips-schema]: trips.json
512509
[ts]: /general-information.md#timestamps
513-
[vehicles]: #vehicles
514-
[vehicle]: /general-information.md#vehicles
515-
[vehicle-types]: /general-information.md#vehicle-types
510+
[vehicles]: /data-types.md#vehicles
511+
[vehicle]: /data-types.md#vehicles
512+
[vehicle-types]: /data-types.md#vehicle-types
513+
[vehicle-status]: /data-types.md#vehicle-states
516514
[vehicle-states]: /modes#vehicle-states
517515
[vehicle-events]: /modes#event-types
518516
[vehicle-event-data]: /general-information.md#event-data

0 commit comments

Comments
 (0)