Skip to content

Commit f28bff4

Browse files
authored
Merge pull request #539 from schnuerle/ms-rc-100-cleanup
Release Candidate 1.0.0 Cleanup
2 parents 233d181 + d415bd0 commit f28bff4

6 files changed

Lines changed: 197 additions & 105 deletions

File tree

.github/PULL_REQUEST_TEMPLATE/default.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ title: <Insert Title>
99

1010
Thank you for your contribution!
1111

12-
*For most Pull Requests, the target branch should be [**`dev`**](https://github.com/openmobilityfoundation/mobility-data-specification/tree/dev). Please ensure you are targeting **`dev`** to avoid complications and help make the Review process as smooth as possible.*
12+
To avoid complications and help make the Review process as smooth as possible, make sure to:
13+
14+
1. Target [**`dev`**](https://github.com/openmobilityfoundation/mobility-data-specification/tree/dev) branch. Please ensure you are targeting **`dev`**, not **`main`**.
15+
1. Keep the *"Allow edits from maintainers"* button checked to help us resolve some issues for you.
16+
1. Be ready to resolve any merge conflicts before we approve your Pull Request.
1317

1418
## Explain pull request
1519

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ for Shareable Dockless Mobility Device Permit Holders](https://www.atlantaga.gov
7676
* **Ulm, Germany**: A draft of the guidelines can be found at [the city's GitHub presence](https://github.com/stadtulm/mds-zonen).
7777
* **Washington, DC**: [Dockless Vehicle Permits](https://ddot.dc.gov/page/dockless-vehicle-permits-district), [terms and conditions](https://ddot.dc.gov/sites/default/files/dc/sites/ddot/2019.11.6%20Shared%20dockless%202020%20Terms%20and%20Conditions%20scooter.pdf), [data reporting standards](https://ddot.dc.gov/sites/default/files/dc/sites/ddot/2019.11.6%20Dockless%20Permit%20TC%20Attatchments.pdf), and [FAQ](https://docs.google.com/document/d/1G2ddANcXl3lShCZInV3uX2NTBfRRu4Fm-tiaCi203QM/).
7878

79-
* _[add your City here by opening a pull request](https://github.com/openmobilityfoundation/mobility-data-specification/compare)_
79+
* _add a city here by [opening a pull request](https://github.com/openmobilityfoundation/mobility-data-specification/compare/dev...dev) or [making an issue](https://github.com/openmobilityfoundation/mobility-data-specification/issues/new?assignees=&labels=&template=feature-request---proposal.md&title=)_.
8080

8181
Other cities include Baltimore, Bellevue, Charlotte, Oakland, and Seattle, via the [NACTO Guidelines for Regulating Shared Micromobility](https://nacto.org/wp-content/uploads/2019/09/NACTO_Shared_Micromobility_Guidelines_Web.pdf), page 48.
8282

agency/README.md

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,46 @@
22

33
This specification contains a collection of RESTful APIs used to specify the digital relationship between *mobility as a service* Providers and the Agencies that regulate them.
44

5-
* Date: 19 Sep 2019
6-
* Version: BETA
7-
85
## Table of Contents
96

107
* [General Information](#general-information)
8+
* [Versioning](#versioning)
9+
* [Responses and Error Messages](#responses-and-error-messages)
10+
* [Authorization](#authorization)
1111
* [Vehicles](#vehicles)
12-
* [Vehicle Registration](#vehicle---register)
13-
* [Vehicle Update](#vehicle---update)
14-
* [Vehicle Events](#vehicle---event)
15-
* [Vehicles Telemetry](#vehicles---telemetry)
12+
* [Vehicle - Register](#vehicle---register)
13+
* [Vehicle - Update](#vehicle---update)
14+
* [Vehicle - Events](#vehicle---event)
15+
* [Vehicle - Telemetry](#vehicle---telemetry)
1616
* [Telemetry Data](#telemetry-data)
1717
* [Stops](#stops)
1818

1919
## General information
2020

2121
This specification uses data types including timestamps, UUIDs, and vehicle state definitions as described in the MDS [General Information][general] document.
2222

23+
[Top][toc]
24+
2325
### Versioning
2426

2527
`agency` APIs must handle requests for specific versions of the specification from clients.
2628

2729
Versioning must be implemented as specified in the [Versioning section][versioning].
2830

31+
[Top][toc]
32+
2933
### Responses and Error Messages
3034

3135
See the [Responses][responses] and [Error Messages][error-messages] sections.
3236

37+
[Top][toc]
38+
3339
### Authorization
3440

3541
When making requests, the Agency API expects `provider_id` to be part of the claims in a [JWT](https://jwt.io/) `access_token` in the `Authorization` header, in the form `Authorization: Bearer <access_token>`. The token issuance, expiration and revocation policies are at the discretion of the Agency.
3642

43+
[Top][toc]
44+
3745
## Vehicles
3846

3947
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.
@@ -83,7 +91,9 @@ A vehicle record is as follows:
8391

8492
_No content returned on vehicle not found._
8593

86-
## Vehicle Registration
94+
[Top][toc]
95+
96+
## Vehicle - Register
8797

8898
The `/vehicles` registration endpoint is used to register a vehicle for use in the Agency jurisdiction.
8999

@@ -120,6 +130,8 @@ _No content returned on success._
120130
| -------------------- | ------------------------------------------------- | ------------------------------- |
121131
| `already_registered` | A vehicle with `device_id` is already registered | |
122132

133+
[Top][toc]
134+
123135
## Vehicle - Update
124136

125137
The `/vehicles` update endpoint is used to update some mutable aspect of a vehicle. For now, only `vehicle_id`.
@@ -148,6 +160,8 @@ _No content returned on success._
148160

149161
_No content returned if no vehicle matching `device_id` is found._
150162

163+
[Top][toc]
164+
151165
## Vehicle - Event
152166

153167
The vehicle `/event` endpoint allows the Provider to control the state of the vehicle including deregister a vehicle from the fleet.
@@ -159,7 +173,7 @@ Path Params:
159173

160174
| Field | Type | Required/Optional | Field Description |
161175
| ------------ | ---- | ----------------- | ---------------------------------------- |
162-
| `device_id` | UUID | Required | ID used in [Register](#vehicle-register) |
176+
| `device_id` | UUID | Required | ID used in [Register](#vehicle---register) |
163177

164178
Body Params:
165179

@@ -185,7 +199,9 @@ Body Params:
185199
| `missing_param` | A required parameter is missing | Array of missing parameters |
186200
| `unregistered` | Vehicle is not registered | |
187201

188-
## Vehicles - Telemetry
202+
[Top][toc]
203+
204+
## Vehicle - Telemetry
189205

190206
The vehicle `/telemetry` endpoint allows a Provider to send vehicle telemetry data in a batch for any number of vehicles in the fleet.
191207

@@ -214,13 +230,15 @@ Body Params:
214230
| `invalid_data` | None of the provided data was valid. | |
215231
| `missing_param` | A required parameter is missing. | Array of missing parameters |
216232

233+
[Top][toc]
234+
217235
## Telemetry Data
218236

219237
A standard point of vehicle telemetry. References to latitude and longitude imply coordinates encoded in the [WGS 84 (EPSG:4326)](https://en.wikipedia.org/wiki/World_Geodetic_System) standard GPS or GNSS projection expressed as [Decimal Degrees](https://en.wikipedia.org/wiki/Decimal_degrees).
220238

221239
| Field | Type | Required/Optional | Field Description |
222240
| -------------- | -------------- | --------------------- | ------------------------------------------------------------ |
223-
| `device_id` | UUID | Required | ID used in [Register](#vehicle-register) |
241+
| `device_id` | UUID | Required | ID used in [Register](#vehicle---register) |
224242
| `timestamp` | [timestamp][ts] | Required | Date/time that event occurred. Based on GPS or GNSS clock |
225243
| `gps` | Object | Required | Telemetry position data |
226244
| `gps.lat` | Double | Required | Latitude of the location |
@@ -234,9 +252,11 @@ A standard point of vehicle telemetry. References to latitude and longitude impl
234252
| `charge` | Float | Required if Applicable | Percent battery charge of vehicle, expressed between 0 and 1 |
235253
| `stop_id` | UUID | Required if Applicable | Stop that the vehicle is currently located at. Only applicable for _docked_ Micromobility. See [Stops][stops] |
236254

255+
[Top][toc]
256+
237257
## Stops
238258

239-
The `/stops` endpoint allows an agency to register Stops.
259+
The `/stops` endpoint allows an agency to register city-managed Stops, or a provider to register self-managed Stops.
240260

241261
**Endpoint:** `/stops`
242262
**Method:** `POST`
@@ -269,10 +289,10 @@ In the case that a `stop_id` query parameter is specified, the `stops` array ret
269289
[hdop]: https://support.esri.com/en/other-resources/gis-dictionary/term/358112bd-b61c-4081-9679-4fca9e3eb926
270290
[propulsion-types]: /general-information.md#propulsion-types
271291
[responses]: /general-information.md#responses
272-
[stops]: /general-information#stops
292+
[stops]: /general-information.md#stops
273293
[toc]: #table-of-contents
274294
[ts]: /general-information.md#timestamps
275295
[vehicle-types]: /general-information.md#vehicle-types
276296
[vehicle-states]: /general-information.md#vehicle-states
277297
[vehicle-events]: /general-information.md#vehicle-state-events
278-
[versioning]: /general-information.md#versioning
298+
[versioning]: /general-information.md#versioning

general-information.md

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,16 @@ This document contains specifications that are shared between the various MDS AP
88
* [Costs and Currencies](#costs-and-currencies)
99
* [Definitions](#definitions)
1010
* [Devices](#devices)
11+
* [Geographic Data][geo]
12+
* [Stop-based Geographic Data](#stop-based-geographic-data)
13+
* [Intersection Operation](#intersection-operation)
1114
* [Propulsion Types](#propulsion-types)
1215
* [Responses](#responses)
1316
* [Error Messages](#error-messages)
1417
* [Strings](#strings)
1518
* [Stops](#stops)
19+
* [Stop Status](#stop-status)
20+
* [GBFS Compatibility](#gbfs-compatibility)
1621
* [Timestamps](#timestamps)
1722
* [UUIDs](#uuids)
1823
* [Vehicle States](#vehicle-states)
@@ -59,6 +64,61 @@ Additionally, `device_id` must remain constant for the device's lifetime of serv
5964

6065
[Top][toc]
6166

67+
## Geographic Data
68+
69+
References to geographic datatypes (Point, MultiPolygon, etc.) imply coordinates encoded in the [WGS 84 (EPSG:4326)][wgs84] standard GPS or GNSS projection expressed as [Decimal Degrees][decimal-degrees].
70+
71+
Whenever an individual location coordinate measurement is presented, it must be
72+
represented as a GeoJSON [`Feature`][geojson-feature] object with a corresponding [`timestamp`][ts] property and [`Point`][geojson-point] geometry:
73+
74+
```json
75+
{
76+
"type": "Feature",
77+
"properties": {
78+
"timestamp": 1529968782421
79+
},
80+
"geometry": {
81+
"type": "Point",
82+
"coordinates": [
83+
-118.46710503101347,
84+
33.9909333514159
85+
]
86+
}
87+
}
88+
```
89+
90+
### Stop-based Geographic Data
91+
92+
When an individual location coordinate measurement corresponds to a [Stop][general-stops],
93+
it must be presented with a `stop_id` property:
94+
95+
```json
96+
{
97+
"type": "Feature",
98+
"properties": {
99+
"timestamp": 1529968782421,
100+
"stop_id": "b813cde2-a41c-4ae3-b409-72ff221e003d"
101+
},
102+
"geometry": {
103+
"type": "Point",
104+
"coordinates": [
105+
-118.46710503101347,
106+
33.9909333514159
107+
]
108+
}
109+
}
110+
```
111+
112+
### Intersection Operation
113+
114+
For the purposes of this specification, the intersection of two geographic datatypes is defined according to the [`ST_Intersects` PostGIS operation][st-intersects]
115+
116+
> If a geometry or geography shares any portion of space then they intersect. For geography -- tolerance is 0.00001 meters (so any points that are close are considered to intersect).
117+
>
118+
> Overlaps, Touches, Within all imply spatial intersection. If any of the aforementioned returns true, then the geometries also spatially intersect. Disjoint implies false for spatial intersection.
119+
120+
[Top][toc]
121+
62122
## Propulsion Types
63123

64124
| `propulsion` | Description |
@@ -241,14 +301,15 @@ The *State Machine Diagram* shows how the `vehicle_state` and `event_type` relat
241301

242302
## Vehicle Types
243303

244-
The list of allowed `vehicle_type` values in MDS is:
304+
The list of allowed `vehicle_type` values in MDS. Aligning with [GBFS vehicle types form factors](https://github.com/NABSA/gbfs/blob/master/gbfs.md#vehicle_typesjson-added-in-v21-rc).
245305

246306
| `vehicle_type` | Description |
247307
|--------------| --- |
248308
| bicycle | Anything with pedals, including recumbents; can include powered assist |
249309
| car | Any automobile |
250310
| scooter | Any motorized mobility device intended for one rider |
251311
| moped | A motorcycle/bicycle hybrid that can be powered or pedaled |
312+
| other | A device that does not fit in the other categories |
252313

253314
[Top][toc]
254315

@@ -277,8 +338,16 @@ If an unsupported or invalid version is requested, the API must respond with a s
277338
[Top][toc]
278339

279340
[agency]: /agency/README.md
341+
[decimal-degrees]: https://en.wikipedia.org/wiki/Decimal_degrees
280342
[gbfs-station-info]: https://github.com/NABSA/gbfs/blob/master/gbfs.md#station_informationjson
281343
[gbfs-station-status]: https://github.com/NABSA/gbfs/blob/master/gbfs.md#station_statusjson
344+
[general-stops]: /general-information.md#stops
345+
[geo]: #geographic-data
346+
[geojson-feature]: https://tools.ietf.org/html/rfc7946#section-3.2
347+
[geojson-point]: https://tools.ietf.org/html/rfc7946#section-3.1.2
282348
[policy]: /policy/README.md
283349
[provider]: /provider/README.md
350+
[st-intersects]: https://postgis.net/docs/ST_Intersects.html
284351
[toc]: #table-of-contents
352+
[ts]: /general-information.md#timestamps
353+
[wgs84]: https://en.wikipedia.org/wiki/World_Geodetic_System

0 commit comments

Comments
 (0)