Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geography-Driven Events #503

Merged
merged 22 commits into from
Dec 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
998bd47
Initial draft
quicklywilliam May 21, 2020
81a756c
fix typos
quicklywilliam May 21, 2020
7a2c557
merged dev to 1.0
quicklywilliam Jun 29, 2020
c5667b7
Merge branch 'dev' into policy-driven-events
quicklywilliam Sep 15, 2020
1d8947a
Post-merge fixes to Agency
quicklywilliam Sep 15, 2020
62d6be0
copy consistency change
quicklywilliam Sep 15, 2020
bd6e585
Specify when geographies are required
quicklywilliam Sep 15, 2020
8dc8a63
push gitignore changes into seperate PR
quicklywilliam Sep 16, 2020
474cc8f
Add 20 minute minimum delay from Policy published_date to start_date
quicklywilliam Oct 9, 2020
ba09ef4
merge dev
quicklywilliam Oct 22, 2020
f750b56
Merge remote-tracking branch 'upstream/dev' into policy-driven-events
quicklywilliam Nov 5, 2020
9424ddb
Mark new features as beta
quicklywilliam Nov 5, 2020
d5e24f1
Clarify that telemetry and event_location fields are required in the …
quicklywilliam Nov 5, 2020
bd54bfc
Clarify and simplify geometry-driven events by removing trip_leave_ge…
quicklywilliam Nov 5, 2020
1811848
Language update to crossed_geography_boundary event
quicklywilliam Nov 5, 2020
d1df0bb
Added language describing the intent/purpose of Geography-Driven Events
quicklywilliam Nov 6, 2020
d53ccd4
crossed_geography_boundary => changed_geographies
quicklywilliam Nov 9, 2020
44923fe
add .DS_Store to git ignore
quicklywilliam Nov 12, 2020
51318df
geometry => geography
quicklywilliam Nov 12, 2020
bccc9a8
Merge remote-tracking branch 'upstream/dev' into policy-driven-events
quicklywilliam Nov 19, 2020
4084adf
Drop optionality for location and telemtry data during beta period
quicklywilliam Dec 3, 2020
10f47c5
Move Geography-Driven events description to General Information
quicklywilliam Dec 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion agency/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ Body Params:
| `vehicle_state` | Enum | Required | see [Vehicle States][vehicle-states] |
| `event_types` | Enum[] | Required | see [Vehicle Events][vehicle-events] |
| `timestamp` | [timestamp][ts] | Required | Date of last event update |
| `telemetry` | [Telemetry](#telemetry-data) | Required | Single point of telemetry |
| `telemetry` | [Telemetry](#telemetry-data) | Required | Single point of telemetry. |
| `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 event. See [Geography Driven Events](#geography-driven-events). Required if `telemetry` is not present. |
| `trip_id` | UUID | Optional | UUID provided by Operator to uniquely identify the trip. Required if `event_types` contains `trip_start`, `trip_end`, `trip_cancel`, `trip_enter_jurisdiction`, or `trip_leave_jurisdiction` |

201 Success Response:
Expand Down Expand Up @@ -326,6 +327,7 @@ If `stop_id` is specified, `GET` will return an array with a single stop record,

[beta]: /general-information.md#beta-features
[general]: /general-information.md
[geography-driven-events]: /general-information.md#geography-driven-events
[error-messages]: /general-information.md#error-messages
[hdop]: https://support.esri.com/en/other-resources/gis-dictionary/term/358112bd-b61c-4081-9679-4fca9e3eb926
[propulsion-types]: /general-information.md#propulsion-types
Expand Down
28 changes: 28 additions & 0 deletions general-information.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,33 @@ For the purposes of this specification, the intersection of two geographic datat
>
> 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.

[Top][toc]

## Geography-Driven Events **[Beta feature](/general-information.md#beta-features):** *Yes (as of 1.1.0)*

Geography-Driven Events is a new MDS feature for Agencies to perform complete Policy compliance monitoring without precise location data. Geography-Driven Events describe individual vehicles in realtime – not just aggregate data. However, rather than receiving the exact location of a vehicle, Agencies receive information about the vehicle's current geographic region. The regions used for Geography-Driven Events correspond to the Geographies in an Agency's current Policy. In this way, the data-shared using Geography-Driven Events is matched to an Agency's particular regulatory needs.

Here's how it works in practice:

1. The Agency creates a geographic Policy Area for a local regulatory need

*Scooters traveling within downtown during peak hours incur a $0.20 fee.*

2. Providers notify the Agency in real-time about events in the Policy Area.

*At 5:21pm scooter X7123 entered downtown.*

3. The Agency can refine their data needs over time by revising their published Policy Areas.

*Agency adds rule disallowing parking on waterfront path, begins receiving data on events within area.*



Agencies that wish to use Geography-Driven Events do so by requiring a new `event_geographies` field in status events. When an Agency is using Geography-Driven Events, Providers must emit a new `changed_geographies` status event whenever a vehicle in a trip enters or leaves a Geography managed by a Policy.

During the Beta period for this feature, location and telemtry data remain required fields. This allows Aggencies to test Geography-Driven Events, measuring its accuracy and efficacy against regulatory systems based on precise location data. After the beta period, if Geography-Driven Events is deemed by OMF to be accurate and effective, the specification will evolve to allow cities to use Geography-Driven Events in lieu of location or telemtry data.


[Top][toc]

## Propulsion Types
Expand Down Expand Up @@ -337,6 +364,7 @@ Vehicles can enter the `unknown` state to and from any other state with the foll
| `unknown` | `on_trip` | `located` | The vehicle has been located by the provider |
| `unknown` | `on_trip` | `unspecified` | The provider cannot definitively state how a vehicle started a trip. |
| `on_trip` | `elsewhere` | `trip_leave_jurisdiction` | A vehicle on a trip left the jurisdiction |
| `on_trip` | `on_trip ` | `changed_geographies` | **[Beta feature](/general-information.md#beta-features):** *Yes (as of 1.1.0)*. The vehicle has entered or left one or more Geographies managed by a Policy. See [Geography Driven Events](#geography-driven-events).|
| `unknown` | `elsewhere` | `comms_restored` | The vehicle transmitted status information after a period of being out of communication. |
| `unknown` | `elsewhere` | `located` | The vehicle has been located by the provider |
| `unknown` | `elsewhere` | `unspecified` | The provider cannot definitively state how a vehicle went `elsewhere`. |
Expand Down
4 changes: 3 additions & 1 deletion policy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ Method: `GET`

[Top][toc]


### Flat Files

To use flat files, policies shall be represented in two (2) files:
Expand Down Expand Up @@ -217,7 +218,7 @@ An individual `Policy` object is defined by the following fields:
| `provider_ids` | UUID[] | Optional | Providers for whom this policy is applicable; empty arrays and `null`/absent implies all Providers. See MDS [provider list](/providers.csv). |
| `description` | String | Required | Description of policy |
| `currency` | String | Optional | An ISO 4217 Alphabetic Currency Code representing the [currency](../general-information.md#costs-and-currencies) of all Rules of [type](#rule-types) `rate`.|
| `start_date` | [timestamp][ts] | Required | Beginning date/time of policy enforcement |
| `start_date` | [timestamp][ts] | Required | Beginning date/time of policy enforcement. In order to give providers sufficient time to poll, `start_date` must be at least 20 minutes after `published_date`. |
| `end_date` | [timestamp][ts] | Optional | End date/time of policy enforcement |
| `published_date` | [timestamp][ts] | Required | Timestamp that the policy was published |
| `prev_policies` | UUID[] | Optional | Unique IDs of prior policies replaced by this one |
Expand Down Expand Up @@ -351,6 +352,7 @@ If a vehicle is matched with a rule, then it _will not_ be considered in the sub

The internal mechanics of ordering are up to the Policy editing and hosting software.


[Top][toc]

[beta]: /general-information.md#beta
Expand Down
4 changes: 3 additions & 1 deletion provider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ Unless stated otherwise by the municipality, this endpoint must return only thos
| `event_types` | Enum[] | Required | [Vehicle event(s)][vehicle-events] for state change, allowable values determined by `vehicle_state` |
| `event_time` | [timestamp][ts] | Required | Date/time that event occurred at. See [Event Times][event-times] |
| `publication_time` | [timestamp][ts] | Optional | Date/time that event became available through the status changes endpoint |
| `event_location` | GeoJSON [Point Feature][geo] | Required | See also [Stop-based Geographic Data][stop-based-geo] |
| `event_location` | GeoJSON [Point Feature][geo] | Required | See also [Stop-based Geographic Data][stop-based-geo]. |
| `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. |
| `battery_pct` | Float | Required if Applicable | Percent battery charge of device, expressed between 0 and 1 |
| `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` |
| `associated_ticket` | String | Optional | Identifier for an associated ticket inside an Agency-maintained 311 or CRM system |
Expand Down Expand Up @@ -424,6 +425,7 @@ In addition to the standard [Provider payload wrapper](#response-format), respon
[gbfs]: https://github.com/NABSA/gbfs
[general-information]: /general-information.md
[geo]: /general-information.md#geographic-data
[geography-driven-events]: /general-information.md#geography-driven-events
[geojson-feature-collection]: https://tools.ietf.org/html/rfc7946#section-3.3
[iana]: https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
[intersection]: /general-information.md#intersection-operation
Expand Down