Skip to content

Commit fb86a6b

Browse files
committed
elevate stop-based geography definition
reference this throughout document stronger language around events that occur at Stops requiring stop_id reference
1 parent d9b6fbf commit fb86a6b

1 file changed

Lines changed: 35 additions & 11 deletions

File tree

provider/README.md

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,28 @@ represented as a GeoJSON [`Feature`][geojson-feature] object with a correspondin
120120
}
121121
```
122122

123+
#### Stop-based Geographic Data
124+
125+
When an individual location coordinate measurement corresponds to a [Stop][general-stops],
126+
it must be presented with a `stop_id` property:
127+
128+
```json
129+
{
130+
"type": "Feature",
131+
"properties": {
132+
"timestamp": 1529968782421,
133+
"stop_id": "b813cde2-a41c-4ae3-b409-72ff221e003d"
134+
},
135+
"geometry": {
136+
"type": "Point",
137+
"coordinates": [
138+
-118.46710503101347,
139+
33.9909333514159
140+
]
141+
}
142+
}
143+
```
144+
123145
#### Intersection Operation
124146

125147
For the purposes of this specification, the intersection of two geographic datatypes is defined according to the [`ST_Intersects` PostGIS operation][st-intersects]
@@ -207,7 +229,7 @@ To represent a route, MDS `provider` APIs must create a GeoJSON [`FeatureCollect
207229

208230
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.
209231

210-
*Docked* mobility providers must include a `stop_id` in the first and last Feature of each `route` by embedding the `stop_id` property in the Feature's `properties` object, as all trips for docked vehicles should originate/end at [Stops](/general-information.md#stops).
232+
Trips that start or end at a [Stop][general-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.
211233

212234
```js
213235
"route": {
@@ -216,7 +238,8 @@ Routes must include at least 2 points: the start point and end point. Routes mus
216238
"type": "Feature",
217239
"properties": {
218240
"timestamp": 1529968782421,
219-
"stop_id": "95084833-6a3f-4770-9919-de1ab4b8989b", // REQUIRED for docked mobility providers, optional for dockless
241+
// Required for Trips starting at a Stop
242+
"stop_id": "95084833-6a3f-4770-9919-de1ab4b8989b",
220243
},
221244
"geometry": {
222245
"type": "Point",
@@ -230,7 +253,8 @@ Routes must include at least 2 points: the start point and end point. Routes mus
230253
"type": "Feature",
231254
"properties": {
232255
"timestamp": 1531007628377,
233-
"stop_id": "b813cde2-a41c-4ae3-b409-72ff221e003d" // REQUIRED for docked mobility providers, optional for dockless
256+
// Required for Trips ending at a Stop
257+
"stop_id": "b813cde2-a41c-4ae3-b409-72ff221e003d"
234258
},
235259
"geometry": {
236260
"type": "Point",
@@ -273,14 +297,10 @@ Unless stated otherwise by the municipality, this endpoint must return only thos
273297
| `event_types` | Enum[] | Required | [Vehicle event(s)][vehicle-events] for state change, allowable values determined by `vehicle_state` |
274298
| `event_time` | [timestamp][ts] | Required | Date/time that event occurred at. See [Event Times][event-times] |
275299
| `publication_time` | [timestamp][ts] | Optional | Date/time that event became available through the status changes endpoint |
276-
| `event_location` | GeoJSON [Point Feature][geo] | Required | See [event_locations](#event-locations)|
300+
| `event_location` | GeoJSON [Point Feature][geo] | Required | See also [Stop-based Geographic Data][stop-based-geo] |
277301
| `battery_pct` | Float | Required if Applicable | Percent battery charge of device, expressed between 0 and 1 |
278302
| `trip_id` | UUID | Required if Applicable | Trip UUID (foreign key to Trips API), required if `event_types` contains `trip_start`, `trip_end`, `trip_cancel`, `trip_enter_jurisdiction`, or `trip_leave_jurisdiction` |
279-
| `associated_ticket` | String | Optional | Identifier for an associated ticket inside an Agency-maintained 311 or CRM system. |
280-
281-
### Event Locations
282-
283-
*Docked* mobility providers must include a `stop_id` in the Point Feature of each `event_location` that occurs at a [Stop](/general-information.md#stops) by embedding the `stop_id` property in the Feature's `properties` object.
303+
| `associated_ticket` | String | Optional | Identifier for an associated ticket inside an Agency-maintained 311 or CRM system |
284304

285305
### Status Changes Query Parameters
286306

@@ -327,6 +347,8 @@ Unless stated otherwise by the municipality, this endpoint must return only thos
327347

328348
> Note: As a result of this definition, consumers should query the [trips endpoint][trips] to infer when vehicles enter or leave the municipality boundary.
329349
350+
See also [Stop-based Geographic Data][stop-based-geo].
351+
330352
The schema and datatypes are the same as those defined for [`/status_changes`][status].
331353

332354
**Endpoint:** `/events`
@@ -408,8 +430,8 @@ In addition to the standard [Provider payload wrapper](#response-format), respon
408430
| `last_event_time` | [timestamp][ts] | Required | Date/time when last state change occurred. See [Event Times][event-times] |
409431
| `last_vehicle_state` | Enum | Required | [Vehicle state][vehicle-states] of most recent state change. |
410432
| `last_event_types` | Enum[] | Required | [Vehicle event(s)][vehicle-events] of most recent state change, allowable values determined by `last_vehicle_state`. |
411-
| `last_event_location` | GeoJSON [Point Feature][geo]| Required | Location of vehicle's last event |
412-
| `current_location` | GeoJSON [Point Feature][geo] | Required if Applicable | Current location of vehicle if different from last event, and the vehicle is not currently on a trip |
433+
| `last_event_location` | GeoJSON [Point Feature][geo]| Required | Location of vehicle's last event. See also [Stop-based Geographic Data][stop-based-geo]. |
434+
| `current_location` | GeoJSON [Point Feature][geo] | Required if Applicable | Current location of vehicle if different from last event, and the vehicle is not currently on a trip. See also [Stop-based Geographic Data][stop-based-geo]. |
413435
| `battery_pct` | Float | Required if Applicable | Percent battery charge of device, expressed between 0 and 1 |
414436

415437
[Top][toc]
@@ -425,6 +447,7 @@ In addition to the standard [Provider payload wrapper](#response-format), respon
425447
[event-times]: #event-times
426448
[gbfs]: https://github.com/NABSA/gbfs
427449
[general-information]: /general-information.md
450+
[general-stops]: /general-information.md#stops
428451
[geo]: #geographic-data
429452
[geojson-feature]: https://tools.ietf.org/html/rfc7946#section-3.2
430453
[geojson-feature-collection]: https://tools.ietf.org/html/rfc7946#section-3.3
@@ -440,6 +463,7 @@ In addition to the standard [Provider payload wrapper](#response-format), respon
440463
[status]: #status-changes
441464
[status-schema]: status_changes.json
442465
[stops]: #stops
466+
[stop-based-geo]: #stop-based-geographic-data
443467
[st-intersects]: https://postgis.net/docs/ST_Intersects.html
444468
[toc]: #table-of-contents
445469
[trips]: #trips

0 commit comments

Comments
 (0)