You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: provider/README.md
+35-11Lines changed: 35 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,6 +120,28 @@ represented as a GeoJSON [`Feature`][geojson-feature] object with a correspondin
120
120
}
121
121
```
122
122
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
+
123
145
#### Intersection Operation
124
146
125
147
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
207
229
208
230
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.
209
231
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.
211
233
212
234
```js
213
235
"route": {
@@ -216,7 +238,8 @@ Routes must include at least 2 points: the start point and end point. Routes mus
216
238
"type":"Feature",
217
239
"properties": {
218
240
"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",
220
243
},
221
244
"geometry": {
222
245
"type":"Point",
@@ -230,7 +253,8 @@ Routes must include at least 2 points: the start point and end point. Routes mus
230
253
"type":"Feature",
231
254
"properties": {
232
255
"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"
234
258
},
235
259
"geometry": {
236
260
"type":"Point",
@@ -273,14 +297,10 @@ Unless stated otherwise by the municipality, this endpoint must return only thos
273
297
|`event_types`| Enum[]| Required |[Vehicle event(s)][vehicle-events] for state change, allowable values determined by `vehicle_state`|
274
298
|`event_time`|[timestamp][ts]| Required | Date/time that event occurred at. See [Event Times][event-times]|
275
299
|`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]|
277
301
|`battery_pct`| Float | Required if Applicable | Percent battery charge of device, expressed between 0 and 1 |
278
302
|`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 |
284
304
285
305
### Status Changes Query Parameters
286
306
@@ -327,6 +347,8 @@ Unless stated otherwise by the municipality, this endpoint must return only thos
327
347
328
348
> Note: As a result of this definition, consumers should query the [trips endpoint][trips] to infer when vehicles enter or leave the municipality boundary.
329
349
350
+
See also [Stop-based Geographic Data][stop-based-geo].
351
+
330
352
The schema and datatypes are the same as those defined for [`/status_changes`][status].
331
353
332
354
**Endpoint:**`/events`
@@ -408,8 +430,8 @@ In addition to the standard [Provider payload wrapper](#response-format), respon
408
430
|`last_event_time`|[timestamp][ts]| Required | Date/time when last state change occurred. See [Event Times][event-times]|
409
431
|`last_vehicle_state`| Enum | Required |[Vehicle state][vehicle-states] of most recent state change. |
410
432
|`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].|
413
435
|`battery_pct`| Float | Required if Applicable | Percent battery charge of device, expressed between 0 and 1 |
414
436
415
437
[Top][toc]
@@ -425,6 +447,7 @@ In addition to the standard [Provider payload wrapper](#response-format), respon
0 commit comments