Skip to content

Commit 14380b0

Browse files
authored
Merge pull request #607 from openmobilityfoundation/feature-provider-reports-static
Provider Reports - Static
2 parents 58985d5 + 02d56d6 commit 14380b0

3 files changed

Lines changed: 118 additions & 2 deletions

File tree

geography/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Placeholder -- link to schema to be added later.
9797
| ---------------- | --------- | --- | --------------------------------------------------------------------------------------------- |
9898
| `name` | String | Required | Name of geography |
9999
| `description` | String | Optional | Detailed description of geography |
100-
| `geography_type` | Sting | Optional | Type of geography, e.g. `municipal_boundary` or `council_district` or custom text. See [Geography Types](#geography-types). |
100+
| `geography_type` | String | Optional | Type of geography, e.g. `municipal_boundary` or `council_district` or custom text. See [Geography Types](#geography-types). |
101101
| `geography_id` | UUID | Required | Unique ID of geography |
102102
| `geography_json` | UUID | Required | The GeoJSON that defines the geographical coordinates. |
103103
| `effective_date` | [timestamp][ts] | Optional | The date at which a Geography is considered "live". Must be at or after `published_date`. |

metrics/core_metrics.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ The following represent the suggested MDS core metric dimensions:
4141
| provider_id | Transportation provider id issued by OMF and [tracked here](/providers.csv) |
4242
| geography_id | [MDS Geography](/geography) |
4343
| vehicle_type | [Vehicle Type](/agency#vehicle-type) defined by MDS |
44-
| special_group_type | [Special Group Type](#special-group-type) defined by MDS |
4544

4645
[Top][toc]
4746

provider/README.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ This specification contains a data standard for *mobility as a service* provider
2020
* [Routes](#routes)
2121
* [Status Changes][status]
2222
* [Status Changes - Query Parameters](#status-changes---query-parameters)
23+
* [Reports](#reports)
24+
* [Reports - Response](#reports---response)
25+
* [Reports - Example](#reports---example)
26+
* [Special Group Type](#special-group-type)
27+
* [Data Redaction](#data-redaction)
2328
* [Realtime Data](#realtime-data)
2429
* [GBFS](#GBFS)
2530
* [Data Latency Requirements][data-latency]
@@ -291,6 +296,118 @@ Without an `event_time` query parameter, `/status_changes` shall return a `400 B
291296

292297
[Top][toc]
293298

299+
300+
## Reports
301+
302+
Reports are information that providers can send back to agencies containing aggregated data that is not contained within other MDS endpoints, like counts of special groups of riders.
303+
304+
The authenticated reports are monthly, historic flat files that may be pre-generated by the provider.
305+
306+
### Reports - Response
307+
308+
**Endpoint:** `/reports`
309+
**Method:** `GET`
310+
**[Beta feature][beta]:** Yes (as of 1.1.0)
311+
**Schema:** TBD when out of beta
312+
**`data` Filename:** monthly file named by year and month, e.g. `/reports/YYYY-MM.csv`
313+
**`data` Payload:** monthly CSV files with the following structure:
314+
315+
| Name | Type | Comments |
316+
| ------------------ | ----------------------------------------- | ------------------------------------------------ |
317+
| StartDate | date | Start date of the data row, ISO 8601 format, local timezone |
318+
| Duration | string | Value is always `P1M` for monthly. Based on [ISO 8601 duration](https://en.wikipedia.org/wiki/ISO_8601#Durations) |
319+
| Special Group Type | [Special Group Type](#special-group-type) | Type that applies to this row |
320+
| Geography ID | [Geography](/geography) | ID that applies to this row. Includes all IDs in /geography. When there is no /geography then return `null` for this value and counts based on the entire operating area. |
321+
| Vehicle Type | [Vehicle Type](/agency#vehicle-type) | Type that applies to this row |
322+
| Trip Count | integer | Count of trips taken for this row |
323+
| Rider Count | integer | Count of unique riders for this row |
324+
325+
#### Data Notes
326+
327+
Report contents include every combination of special group types, geography IDs, and vehicle types in operation for each month since the provider began operations in the jurisdiction. New files are added monthly in addition to the previous monthly historic files.
328+
329+
Counts are calculated based the city's local time zone, and this time zone is returned within the `StartDate` value. For months where there is a Daylight Saving Time change, use the timezone that is in the majority of the month.
330+
331+
All geography IDs included in the city published [Geography](/geography) API endpoint are included in the report results. In lieu of serving an API, this can alternately be a [flat file](/geography#file-format) created by the city and sent to the provider via link. If there is no `/geography` available, then counts are for the entire agency operating area, and `null` is returned for Geography ID.
332+
333+
### Reports - Example
334+
335+
For 3 months of provider operation in a city (September 2019 through November 2019) for 3 geographies, 2 vehicle types, and 1 special group. Timezone is Eastern Time in the US which is _-4_ from UTC before November 3, 2019, and _-5_ after. Values of `-1` represent [redacted data](#data-redaction) counts.
336+
337+
**September 2019** `/reports/2019-09.csv`
338+
339+
```csv
340+
StartDate,Duration,Special Group Type,Geography ID,Vehicle Type,Trip Count,Rider Count
341+
2019-09-01T00:00-04,P1M,all_riders,44428624-186b-4fc3-a7fb-124f487464a1,scooter,1302,983
342+
2019-09-01T00:00-04,P1M,low_income,44428624-186b-4fc3-a7fb-124f487464a1,scooter,201,104
343+
2019-09-01T00:00-04,P1M,all_riders,44428624-186b-4fc3-a7fb-124f487464a1,bicycle,530,200
344+
2019-09-01T00:00-04,P1M,low_income,44428624-186b-4fc3-a7fb-124f487464a1,bicycle,75,26
345+
2019-09-01T00:00-04,P1M,all_riders,03db06d0-3998-406a-92c7-25a83fc2784a,scooter,687,450
346+
2019-09-01T00:00-04,P1M,low_income,03db06d0-3998-406a-92c7-25a83fc2784a,scooter,98,45
347+
2019-09-01T00:00-04,P1M,all_riders,03db06d0-3998-406a-92c7-25a83fc2784a,bicycle,256,104
348+
2019-09-01T00:00-04,P1M,low_income,03db06d0-3998-406a-92c7-25a83fc2784a,bicycle,41,16
349+
2019-09-01T00:00-04,P1M,all_riders,8ad39dc3-005b-4348-9d61-c830c54c161b,scooter,201,140
350+
2019-09-01T00:00-04,P1M,low_income,8ad39dc3-005b-4348-9d61-c830c54c161b,scooter,35,21
351+
2019-09-01T00:00-04,P1M,all_riders,8ad39dc3-005b-4348-9d61-c830c54c161b,bicycle,103,39
352+
2019-09-01T00:00-04,P1M,low_income,8ad39dc3-005b-4348-9d61-c830c54c161b,bicycle,15,-1
353+
```
354+
355+
**October 2019** `/reports/2019-10.csv`
356+
357+
```csv
358+
StartDate,Duration,Special Group Type,Geography ID,Vehicle Type,Trip Count,Rider Count
359+
2019-10-01T00:00-04,P1M,all_riders,44428624-186b-4fc3-a7fb-124f487464a1,scooter,1042,786
360+
2019-10-01T00:00-04,P1M,low_income,44428624-186b-4fc3-a7fb-124f487464a1,scooter,161,83
361+
2019-10-01T00:00-04,P1M,all_riders,44428624-186b-4fc3-a7fb-124f487464a1,bicycle,424,160
362+
2019-10-01T00:00-04,P1M,low_income,44428624-186b-4fc3-a7fb-124f487464a1,bicycle,60,0
363+
2019-10-01T00:00-04,P1M,all_riders,03db06d0-3998-406a-92c7-25a83fc2784a,scooter,550,360
364+
2019-10-01T00:00-04,P1M,low_income,03db06d0-3998-406a-92c7-25a83fc2784a,scooter,78,36
365+
2019-10-01T00:00-04,P1M,all_riders,03db06d0-3998-406a-92c7-25a83fc2784a,bicycle,205,83
366+
2019-10-01T00:00-04,P1M,low_income,03db06d0-3998-406a-92c7-25a83fc2784a,bicycle,33,13
367+
2019-10-01T00:00-04,P1M,all_riders,8ad39dc3-005b-4348-9d61-c830c54c161b,scooter,161,112
368+
2019-10-01T00:00-04,P1M,low_income,8ad39dc3-005b-4348-9d61-c830c54c161b,scooter,28,-1
369+
2019-10-01T00:00-04,P1M,all_riders,8ad39dc3-005b-4348-9d61-c830c54c161b,bicycle,82,31
370+
2019-10-01T00:00-04,P1M,low_income,8ad39dc3-005b-4348-9d61-c830c54c161b,bicycle,-1,0
371+
```
372+
373+
**November 2019** `/reports/2019-11.csv`
374+
375+
```csv
376+
StartDate,Duration,Special Group Type,Geography ID,Vehicle Type,Trip Count,Rider Count
377+
2019-11-01T00:00-05,P1M,all_riders,44428624-186b-4fc3-a7fb-124f487464a1,scooter,834,629
378+
2019-11-01T00:00-05,P1M,low_income,44428624-186b-4fc3-a7fb-124f487464a1,scooter,129,66
379+
2019-11-01T00:00-05,P1M,all_riders,44428624-186b-4fc3-a7fb-124f487464a1,bicycle,339,128
380+
2019-11-01T00:00-05,P1M,low_income,44428624-186b-4fc3-a7fb-124f487464a1,bicycle,48,-1
381+
2019-11-01T00:00-05,P1M,all_riders,03db06d0-3998-406a-92c7-25a83fc2784a,scooter,440,288
382+
2019-11-01T00:00-05,P1M,low_income,03db06d0-3998-406a-92c7-25a83fc2784a,scooter,62,29
383+
2019-11-01T00:00-05,P1M,all_riders,03db06d0-3998-406a-92c7-25a83fc2784a,bicycle,164,66
384+
2019-11-01T00:00-05,P1M,low_income,03db06d0-3998-406a-92c7-25a83fc2784a,bicycle,26,0
385+
2019-11-01T00:00-05,P1M,all_riders,8ad39dc3-005b-4348-9d61-c830c54c161b,scooter,129,90
386+
2019-11-01T00:00-05,P1M,low_income,8ad39dc3-005b-4348-9d61-c830c54c161b,scooter,22,-1
387+
2019-11-01T00:00-05,P1M,all_riders,8ad39dc3-005b-4348-9d61-c830c54c161b,bicycle,-1,25
388+
2019-11-01T00:00-05,P1M,low_income,8ad39dc3-005b-4348-9d61-c830c54c161b,bicycle,0,0
389+
```
390+
391+
### Special Group Type
392+
393+
Here are the possible values for the `special_group_type` dimension field:
394+
395+
| Name | Description |
396+
| ---------- | --------------------------------------------------------------------------------------------------------------------- |
397+
| low_income | Trips where a low income discount is applied by the provider, e.g., a discount from a qualified provider equity plan. |
398+
| all_riders | All riders from any group |
399+
400+
Other special group types may be added in future MDS releases as relevant agency and provider use cases are identified. When additional special group types or metrics are proposed, a thorough review of utility and relevance in program oversight, evaluation, and policy development should be done by OMF Working Groups, as well as any privacy implications by the OMF Privacy Committee.
401+
402+
### Data Redaction
403+
404+
Some combinations of parameters may return a small count of trips, which could increase a privacy risk of re-identification. To correct for that, Reports does not return data below a certain count of results. This is called k-anonymity, and the threshold is set at a k-value of 10.
405+
406+
If the report returns count values from 1 through 10, then a number of value `-1` is returned to represent redacted data. Counts of `0` are still returned as usual. This requirement is applied to both counts of trips and unique riders.
407+
408+
[Top][toc]
409+
410+
294411
## Realtime Data
295412

296413
### GBFS

0 commit comments

Comments
 (0)