Skip to content

Commit 024d553

Browse files
authored
Merge pull request #653 from RideReport/issue-616
Resolve #616 and #589 by bringing rich telemetry data into definition of Geographic Data
2 parents b52d3f7 + 27b7740 commit 024d553

3 files changed

Lines changed: 30 additions & 10 deletions

File tree

agency/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ A standard point of vehicle telemetry. References to latitude and longitude impl
250250
| `gps.lng` | Double | Required | Longitude of the location |
251251
| `gps.altitude` | Double | Required if Available | Altitude above mean sea level in meters |
252252
| `gps.heading` | Double | Required if Available | Degrees - clockwise starting at 0 degrees at true North |
253-
| `gps.speed` | Float | Required if Available | Speed in meters / sec |
254-
| `gps.accuracy` | Float | Required if Available | Accuracy in meters |
253+
| `gps.speed` | Float | Required if Available | Estimated speed in meters / sec as reported by the GPS chipset |
254+
| `gps.accuracy` | Float | Required if Available | Horizontal accuracy, in meters |
255255
| `gps.hdop` | Float | Required if Available | Horizontal GPS or GNSS accuracy value (see [hdop][hdop]) |
256256
| `gps.satellites` | Integer | Required if Available | Number of GPS or GNSS satellites
257257
| `charge` | Float | Required if Applicable | Percent battery charge of vehicle, expressed between 0 and 1 |

general-information.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This document contains specifications that are shared between the various MDS AP
99
* [Definitions](#definitions)
1010
* [Devices](#devices)
1111
* [Geographic Data][geo]
12+
* [Geographic Telemetry Data](#geographic-telemetry-data)
1213
* [Stop-based Geographic Data](#stop-based-geographic-data)
1314
* [Intersection Operation](#intersection-operation)
1415
* [Geography-Driven Events](#geography-driven-events)
@@ -73,14 +74,32 @@ Additionally, `device_id` must remain constant for the device's lifetime of serv
7374

7475
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]. When points are used, you may assume a 20 meter buffer around the point when needed.
7576

76-
Whenever an individual location coordinate measurement is presented, it must be
77-
represented as a GeoJSON [`Feature`][geojson-feature] object with a corresponding [`timestamp`][ts] property and [`Point`][geojson-point] geometry:
77+
### Geographic Telemetry Data
78+
79+
Whenever a vehicle location coordinate measurement is presented, it must be
80+
represented as a GeoJSON [`Feature`][geojson-feature] object with a corresponding
81+
`properties` object with the following properties:
82+
83+
84+
| Field | Type | Required/Optional | Field Description |
85+
| -------------- | -------------- | --------------------- | ------------------------------------------------------------ |
86+
| `timestamp` | [timestamp][ts] | Required | Date/time that event occurred. Based on GPS or GNSS clock |
87+
| `altitude` | Double | Required if Available | Altitude above mean sea level in meters |
88+
| `heading` | Double | Required if Available | Degrees - clockwise starting at 0 degrees at true North |
89+
| `speed` | Float | Required if Available | Estimated speed in meters / sec as reported by the GPS chipset |
90+
| `accuracy` | Float | Required if Available | Horizontal accuracy, in meters |
91+
| `hdop` | Float | Required if Available | Horizontal GPS or GNSS accuracy value (see [hdop][hdop]) |
92+
| `satellites` | Integer | Required if Available | Number of GPS or GNSS satellites
93+
94+
Example of a vehicle location GeoJSON [`Feature`][geojson-feature] object:
7895

7996
```json
8097
{
8198
"type": "Feature",
8299
"properties": {
83-
"timestamp": 1529968782421
100+
"timestamp": 1529968782421,
101+
"accuracy": 10,
102+
"speed": 1.21
84103
},
85104
"geometry": {
86105
"type": "Point",
@@ -444,6 +463,7 @@ If an unsupported or invalid version is requested, the API must respond with a s
444463

445464
[agency]: /agency/README.md
446465
[decimal-degrees]: https://en.wikipedia.org/wiki/Decimal_degrees
466+
[hdop]: https://en.wikipedia.org/wiki/Dilution_of_precision_(navigation)
447467
[gbfs-station-info]: https://github.com/NABSA/gbfs/blob/master/gbfs.md#station_informationjson
448468
[gbfs-station-status]: https://github.com/NABSA/gbfs/blob/master/gbfs.md#station_statusjson
449469
[general-stops]: /general-information.md#stops

provider/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ For the near-ish real time use cases, please use the [events][events] endpoint.
218218

219219
### Routes
220220

221-
To represent a route, MDS `provider` APIs must create a GeoJSON [`FeatureCollection`][geojson-feature-collection], which includes every [observed point][geo] in the route, even those which occur outside the [municipality boundary][muni-boundary].
221+
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].
222222

223223
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.
224224

@@ -290,7 +290,7 @@ Unless stated otherwise by the municipality, this endpoint must return only thos
290290
| `event_types` | Enum[] | Required | [Vehicle event(s)][vehicle-events] for state change, allowable values determined by `vehicle_state` |
291291
| `event_time` | [timestamp][ts] | Required | Date/time that event occurred at. See [Event Times][event-times] |
292292
| `publication_time` | [timestamp][ts] | Optional | Date/time that event became available through the status changes endpoint |
293-
| `event_location` | GeoJSON [Point Feature][geo] | Required | See also [Stop-based Geographic Data][stop-based-geo]. |
293+
| `event_location` | GeoJSON [Point Feature][point-geo] | Required | See also [Stop-based Geographic Data][stop-based-geo]. |
294294
| `event_geographies` | UUID[] | Optional | **[Beta feature](/general-information.md#beta-features):** *Yes (as of 1.1.0)*. Array of Geography UUIDs consisting of every Geography that contains the location of the status change. See [Geography Driven Events][geography-driven-events]. Required if `event_location` is not present. |
295295
| `battery_pct` | Float | Required if Applicable | Percent battery charge of device, expressed between 0 and 1 |
296296
| `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` |
@@ -573,8 +573,8 @@ In addition to the standard [Provider payload wrapper](#response-format), respon
573573
| `last_event_time` | [timestamp][ts] | Required | Date/time when last state change occurred. See [Event Times][event-times] |
574574
| `last_vehicle_state` | Enum | Required | [Vehicle state][vehicle-states] of most recent state change. |
575575
| `last_event_types` | Enum[] | Required | [Vehicle event(s)][vehicle-events] of most recent state change, allowable values determined by `last_vehicle_state`. |
576-
| `last_event_location` | GeoJSON [Point Feature][geo]| Required | Location of vehicle's last event. See also [Stop-based Geographic Data][stop-based-geo]. |
577-
| `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]. |
576+
| `last_event_location` | GeoJSON [Point Feature][point-geo]| Required | Location of vehicle's last event. See also [Stop-based Geographic Data][stop-based-geo]. |
577+
| `current_location` | GeoJSON [Point Feature][point-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]. |
578578
| `battery_pct` | Float | Required if Applicable | Percent battery charge of device, expressed between 0 and 1 |
579579

580580
[Top][toc]
@@ -590,7 +590,6 @@ In addition to the standard [Provider payload wrapper](#response-format), respon
590590
[event-times]: #event-times
591591
[gbfs]: https://github.com/NABSA/gbfs
592592
[general-information]: /general-information.md
593-
[geo]: /general-information.md#geographic-data
594593
[geography-driven-events]: /general-information.md#geography-driven-events
595594
[geojson-feature-collection]: https://tools.ietf.org/html/rfc7946#section-3.3
596595
[iana]: https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
@@ -599,6 +598,7 @@ In addition to the standard [Provider payload wrapper](#response-format), respon
599598
[json-api-pagination]: http://jsonapi.org/format/#fetching-pagination
600599
[json-schema]: https://json-schema.org
601600
[muni-boundary]: #municipality-boundary
601+
[point-geo]: /general-information.md#geographic-telemetry-data
602602
[propulsion-types]: /general-information.md#propulsion-types
603603
[responses]: /general-information.md#responses
604604
[status]: #status-changes

0 commit comments

Comments
 (0)