Skip to content

Commit 6ebc72d

Browse files
authored
Merge pull request #179 from openmobilityfoundation/jacobmalleau-enforcementimprovements
Adding Enforcement Attributes to Demand Data
2 parents 53589fe + 156c3f0 commit 6ebc72d

File tree

3 files changed

+84
-31
lines changed

3 files changed

+84
-31
lines changed

data-types.md

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,56 @@ This CDS data types page catalogs the data objects (fields, types, requirements,
44

55
## Table of Contents
66

7+
- [Enforcement](#enforcement)
8+
- [Violations](#violations)
79
- [External Reference](#external-reference)
810

11+
## Enforcement
12+
13+
The Enforcement object describes a specific set of features from a data feed or API that is relevant to an enforcement Curb Event. This allows CDS users to reference detailed enforcement data separate from the main API endpoints.
14+
15+
Where a citation could represent multiple violations, an enforcement object contains an array that enumerates the violations for a single citation. Where a citation can only represent a single violation, multiple Curb Events may be published, each with a single violation in the array.
16+
17+
The `enforcement` object is a JSON *object* with the following fields:
18+
19+
| Name | Type | Required/Optional | Description |
20+
| ---------------- | ------ | ----------------- | ------------- |
21+
| `enforcement_id` | UUID | Required | An identifer unique to the enforcement incident, generated the first time an enforcement event is recorded, and referenced in future related enforcement events. Multiple Curb Events (ex: `vehicle_violation_start`, `vehicle_violation_end`, or `citation_issued`) that relate to the same enforcement activity can share the same `enforcement_id`. |
22+
| `citation_id` | String | Optional | A unique id which represents a single citation. |
23+
| `is_warning` | Boolean | Optional | A boolean value to indicate if the enforcment action is being processed as a warning. |
24+
| `action_taken` | String | Optional | Indicates how the violation was enforced. Typical well-known values are `citation_registered`, `citation_posted`, `citation_served`, or `citation_emailed`. |
25+
| `citation_cost` | String | Optional | The total cost of all violations associated to this enforcement action. |
26+
| `violations` | Array of Violations | Optional | An array of Violation objects that indicate the one-to-many violations associated to this enforcement event. |
27+
28+
[Top][toc]
29+
30+
### Violations
31+
32+
The Violations object describes the violations associated to an enforcement action that can occur as a Curb Event.
33+
34+
The `violations` object is a JSON *object* with the following fields:
35+
36+
| Name | Type | Required/Optional | Description |
37+
| ---------------- | ------ | ----------------- | ------------- |
38+
| `municipal_code` | String | Optional | The unique code created by the municipality or enforcement agency to identify the type of rule being enforced. |
39+
| `violation_name` | String | Optional | The city/municipal, county, state, provincial, or federal code that was violated. |
40+
| `violaton_cost` | String | Optional | The original cost associated with the violation. |
41+
42+
[Top][toc]
43+
944
## External Reference
1045

1146
An External Reference object describes a specific feature from an external data source that is relevant to a part of CDS data. This allows CDS users to reference other data sources that impact or provide information about a CDS object, and see more details at an external URL. Data sources can be anything available via a URL, including an existing data standard (MDS, WZDx, CWZ, GTFS, GBFS, CDS, etc), a custom feed, API, document, web page, report, etc.
1247

13-
An `external_reference` is a JSON *array* with the following fields within objects:
48+
The `external_reference` object is a JSON *array* with the following fields:
1449

15-
| Name | Type | Required/Optional | Description |
16-
| ------ | ------ | ------------------- | ------------- |
17-
| `reference_url` | URL | Required | A web-accessible identifier URL for the source of the publicly or privately accessible data feed, document, website, etc. This MUST be a full HTTPS URL pointing to a location which contains more information impacting or explaining the location, event, or policy, etc. |
18-
| `name` | String | Optional | Name of the data source for reference. E.g. "WZDx", "CWZ", "MDS", "GBFS", "GTFS", "CDS". |
19-
| `public` | Boolean | Optional | Is this data source able to be viewed with out any sort of authentication? If `true`, the `reference_url` is public. If `false`, the `reference_url` requires some sort of authentication, authorization, or API key to access. This is an informational field to set access expectations for the feed user, and does not provide any credentials directly unless explicitly contained in the `reference_url`. |
20-
| `identifier_name` | String | Optional | The name of the data field or object that is referenced by the unique `ids`. E.g. "id", "trip_id", "vehicle_id", "RoadEventFeature", etc, if relevant and available in `reference_url`. |
21-
| `ids` | Array of Strings | Optional | An array of one or more **ids** from the `reference_url` that impacts the use of or relationship to part of CDS, e.g. a curb zone, curb space, curb area, curb event, etc. The **ids** and their details are be found in the referenced `reference_url`. |
50+
| Name | Type | Required/Optional | Description |
51+
| ----------------- | ------- | ------------------- | ------------- |
52+
| `reference_url` | URL | Required | A web-accessible identifier URL for the source of the publicly or privately accessible data feed, document, website, etc. This MUST be a full HTTPS URL pointing to a location which contains more information impacting or explaining the location, event, or policy, etc. |
53+
| `name` | String | Optional | Name of the data source for reference. E.g. "WZDx", "CWZ", "MDS", "GBFS", "GTFS", "CDS". |
54+
| `public` | Boolean | Optional | Is this data source able to be viewed with out any sort of authentication? If `true`, the `reference_url` is public. If `false`, the `reference_url` requires some sort of authentication, authorization, or API key to access. This is an informational field to set access expectations for the feed user, and does not provide any credentials directly unless explicitly contained in the `reference_url`. |
55+
| `identifier_name` | String | Optional | The name of the data field or object that is referenced by the unique `ids`. E.g. "id", "trip_id", "vehicle_id", "RoadEventFeature", etc, if relevant and available in `reference_url`. |
56+
| `ids` | Array of Strings | Optional | An array of one or more **ids** from the `reference_url` that impacts the use of or relationship to part of CDS, e.g. a curb zone, curb space, curb area, curb event, etc. The **ids** and their details are be found in the referenced `reference_url`. |
2257

2358
[Top][toc]
2459

events/README.md

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ All query parameters are optional.
9696

9797
[Top][toc]
9898

99-
## Push Event
99+
## Push Event
100100

101101
Endpoint: `/events/event`
102102
Method: `POST`
@@ -160,10 +160,10 @@ A Curb Event is represented as a JSON object, whose fields are as follows:
160160
| `event_time` | [Timestamp][ts] | Required | Time at which the event occurred. |
161161
| `event_publication_time` | [Timestamp][ts] | Required | Time at which the event became available for consumption by this API. |
162162
| `event_session_id` | [UUID][uuid] | Optional | May be provided to tie known connected `park_start` and `park_end` event types together by a unique session ID. If _not_ confident of being able to determine a `park_end` event at some time after `park_start` is recorded (i.e., you cannot detect when a vehicle departs), then do _not_ use session_id. This field may be most useful to payment companies who provide their source data as sessions (typical for transaction data). _Note also_: the use of the term "session" across CDS means the start and end of curb usage of a vehicle, not necessarily a financial or payment session or transaction. |
163-
| `curb_zone_id` | [UUID][uuid] | Conditionally Required | Unique ID of the Curb Zone where the event occurred. Required for events that occurred at a known Curb Zone for ALL _event_types_. |
164-
| `curb_area_ids` | Array of [UUID][uuid] | Conditionally Required | Unique IDs of the Curb Area where the event occurred. Since Curb Areas can overlap, an event may happen in more than one. Required for events that occurred in a known Curb Area, if known and used, for these event_types: _enter_area, exit_area, park_start, park_end_ |
165-
| `curb_space_id` | [UUID][uuid] | Conditionally Required | Unique ID of the Curb Space where the event occurred. Required for events that occurred at a known Curb Space, if known and used, for these event_types: _park_start, park_end, enter_area, exit_area_ |
166-
| `curb_object_id` | [UUID][uuid] | Conditionally Required | Unique ID of the Curb Object where the event occurred. Required for events that occurred at a known Curb Object, if known and used, for these event_types: _park_start, park_end, enter_area, exit_area_ |
163+
| `curb_zone_id` | [UUID][uuid] | Conditionally Required | Unique ID of the Curb Zone where the event occurred. Required for events that occurred in a known Curb Zone, if known and used, for ALL _event_types_. |
164+
| `curb_area_ids` | Array of [UUID][uuid] | Conditionally Required | Unique IDs of the Curb Area where the event occurred. Since Curb Areas can overlap, an event may happen in more than one. Required for events that occurred in a known Curb Area, if known and used, for ALL _event_types_. |
165+
| `curb_space_id` | [UUID][uuid] | Conditionally Required | Unique ID of the Curb Space where the event occurred. Required for events that occurred at a known Curb Space, if known and used, for ALL _event_types_. |
166+
| `curb_object_id` | [UUID][uuid] | Conditionally Required | Unique ID of the Curb Object where the event occurred. Required for events that occurred at a known Curb Object, if known and used, for ALL _event_types_. |
167167
| `data_source_type` | Enum [Source Type](#source-type) | Required | General category of the source creating the event. |
168168
| `data_source_operator_id` | [UUID][uuid] | Conditionally Required | Unique identifier of the entity responsible for operating the event data source. IDs can identify the fleet operator sending a data feed, or the organization (company or city) operating the sensor. IDs for fleet operators are required and global and come from the [data_source_operators.csv](/data_source_operators.csv) file, and optional for others. Read our [How to Get a Data Source Operator ID](https://github.com/openmobilityfoundation/curb-data-specification/wiki/Adding-a-CDS-Data-Source-Operator-ID) guide. An agency at their discretion may allow a small, local company to simply provide a consistent `data_source_operator_name` string instead of this field, otherwise this field is required. |
169169
| `data_source_operator_name` | String | Optional | Name of the provider responsible for operating the vehicle, device, or sensor at the time of the event. May be sent along with `data_source_operator_id` or on its own for small operators at the discretion of the city. |
@@ -191,6 +191,7 @@ A Curb Event is represented as a JSON object, whose fields are as follows:
191191
| `vehicle_blocked_lane_types` | Array of [Lane Type](#lane-type) | Conditionally Required | Type(s) of lane blocked by the vehicle performing the event. If no lanes are blocked by the vehicle performing the event, the array should be empty. Required for sources capable of determining it for the following event_types: _park_start_ |
192192
| `curb_occupants` | Array of [Curb Occupant](#curb-occupants) | Conditionally Required | Current occupants of the Curb Zone. If the sensor is capable of identifying the linear location of the vehicle, then elements are sorted in ascending order according to the start property of the linear reference. Otherwise, elements appear in no particular order. Required for sources capable of determining it for the following event_types: _park_start, park_end, scheduled_report_ |
193193
| `actual_cost` | Integer | Optional | If available from the source, the actual cost, in the currency defined in currency, paid by the curb user for this event. The currency type is sent in with the [REST Endpoints](#rest-endpoints) JSON object. All costs should be given as integers in the currency's smallest unit. As an example, to represent $1 USD, specify an amount of 100 (for 100 cents). |
194+
| `enforcement` | [Enforcement][enforcement] | Optional | Enforcement information related to this Curb Event, relevant to the moment in time the event happens. Only used for enforcement related events such as `vehicle_detected`, `vehicle_violation_start`, `vehicle_violation_end`, and `citation_issued`. |
194195
| `payment_channel` | [Payment Channel](#payment-channel) | Conditionally Required | If available from the source, the medium by which a user submitted payment. |
195196
| `payment_method` | [Payment Method](#payment-method) | Conditionally Required | If available from the source, the method used to pay for this event. |
196197
| `payment_transaction_id` | String | Conditionally Required | The transaction ID of the payment if available from the source and different from the `event_id`. |
@@ -205,14 +206,18 @@ Curb Event Type `event_type` enumerates the set of possible types of Curb Event.
205206

206207
| Name | Description |
207208
|--------------------|-------------|
208-
| `comms_lost` | communications with the event source were lost |
209-
| `comms_restored` | communications with the event source were restored |
210-
| `decommissioned` | event source was decommissioned |
211-
| `park_start` | a vehicle stopped, parked, or double parked |
212-
| `park_end` | a parked vehicle leaving a parked or stopped state and resuming movement |
213-
| `scheduled_report` | event source reported status at a scheduled interval |
214-
| `enter_area` | vehicle enters the relevant geographic area |
215-
| `exit_area` | vehicle exits the relevant geographic area |
209+
| `comms_lost` | Communications with the event source were lost |
210+
| `comms_restored` | Communications with the event source were restored |
211+
| `decommissioned` | Event source was decommissioned |
212+
| `park_start` | A vehicle stopped, parked, or double parked |
213+
| `park_end` | A parked vehicle leaving a parked or stopped state and resuming movement |
214+
| `scheduled_report` | Event source reported status at a scheduled interval |
215+
| `enter_area` | Vehicle enters the relevant geographic area. This differs from `vehicle_detected` since `enter_area` represents the tracking of a vehicle crossing the geo-boundary of an area/location. |
216+
| `exit_area` | Vehicle exits the relevant geographic area |
217+
| `vehicle_detected` | Detection or observation of a vehicle within or near a curb zone. Can originate from manual surveying, automated license plate recognition (LPR) systems, or other detection methods. This differs from the `enter_area` and `exit_area` events where a `vehicle_detected` event does not require the vehicle to be crossing the geo-boundary of an area/location. |
218+
| `vehicle_violation_start` | Start of a compliance violation at a curb location, triggered when a vehicle is not permitted or has exceeded allowed time limits. This event may be published after detecting a vehicle but does not require a `vehicle_detected` event. |
219+
| `vehicle_violation_end` | Resolution of a compliance violation, when the vehicle is no longer in violation of regulations. Used for time-based violations where the end of the violation can be detected. Requires a preceding `vehicle_violation_start` event for the same vehicle. |
220+
| `citation_issued` | Issuance of a ticket or citation to a vehicle. May be published in addition to a related `vehicle_violation_start` event. |
216221

217222
[Top][toc]
218223

@@ -222,14 +227,14 @@ Curb Data Source Type `data_source_type` enumerates the set of possible categori
222227

223228
| Name | Description |
224229
|----------------| ----------- |
225-
| `data_feed` | directly from a provider data feed sent to the agency |
226-
| `camera` | video or static image processing source |
227-
| `above_ground` | sensor deployed above ground |
228-
| `in_ground` | sensor deployed in the ground |
229-
| `meter` | a smart parking meter |
230-
| `payment` | from payment system or app |
231-
| `in_person` | an individual on site recording the event digitally or otherwise |
232-
| `other` | sources not enumerated above |
230+
| `data_feed` | Directly from a provider data feed sent to the agency |
231+
| `camera` | Video or static image processing source |
232+
| `above_ground` | Sensor deployed above ground |
233+
| `in_ground` | Sensor deployed in the ground |
234+
| `meter` | A smart parking meter |
235+
| `payment` | From payment system or app |
236+
| `in_person` | An individual on site recording the event digitally or otherwise |
237+
| `other` | Sources not enumerated above |
233238

234239
[Top][toc]
235240

@@ -344,6 +349,8 @@ from a credit card payment made via a mobile app, for example.
344349
| `website` | User went to a standard website to pay, maybe directed by QR code. |
345350
| `other` | Some payment channel not captured above (please submit a pull request!). |
346351

352+
[Top][toc]
353+
347354
### Payment Method
348355

349356
Strings used to indicate how a curb user paid for a curb event.
@@ -405,6 +412,8 @@ For details on the CDS schema in OpenAPI format and on Stoplight, please referen
405412
[Top][toc]
406413

407414
[bulk-responses]: /general-information.md#bulk-responses
415+
[enforcement]: ../data-types.md#enforcement
416+
[violations]: ../data-types.md#violations
408417
[error-messages]: /general-information.md#error-messages
409418
[external-reference]: ../data-types.md#external-reference
410419
[iana]: https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml

0 commit comments

Comments
 (0)