forked from ChelseaKR/gtfs-scorecard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.js
More file actions
427 lines (409 loc) · 14.7 KB
/
Copy pathconstants.js
File metadata and controls
427 lines (409 loc) · 14.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
// GENERATED — do not edit; run `scorecard render-constants`.
// Source of truth: pipeline/src/scorecard_pipeline/constants_export.py
// (grade bands from score.py, freshness thresholds from metrics.py, category
// and severity labels from site_shell.py, rule links from rule_links.py).
// pipeline/tests/test_generated_constants.py fails CI when this file drifts.
export const STALE_FEED_DAYS = 365;
export const SERVICE_HORIZON_REVIEW_YEARS = 10;
export const GRADE_BANDS = [
{
"grade": "A",
"min_score": 90.0
},
{
"grade": "B",
"min_score": 80.0
},
{
"grade": "C",
"min_score": 70.0
},
{
"grade": "D",
"min_score": 60.0
},
{
"grade": "F",
"min_score": 0.0
}
];
export const GRADE_ORDER = [
"F",
"D",
"C",
"B",
"A"
];
export const GRADE_RANK = {
"A": 4,
"B": 3,
"C": 2,
"D": 1,
"F": 0
};
export const CATEGORY_LABELS = {
"completeness": "Rider experience",
"correctness": "Correctness",
"freshness": "Freshness",
"realtime": "Realtime quality"
};
export const CATEGORY_ORDER = [
"correctness",
"freshness",
"completeness",
"realtime"
];
export const SEVERITY_LABELS = {
"ERROR": "Error",
"INFO": "Info",
"WARNING": "Warning"
};
export const TIER_LABELS = {
"large": "large",
"medium": "mid-size",
"small": "small"
};
export const FIX_DOCS_BASE = "https://github.com/ChelseaKR/gtfs-scorecard/blob/main/docs/fixes/";
export const VALIDATOR_RULES_PAGE = "https://gtfs-validator.mobilitydata.org/rules.html";
export const AUTHORITY_LABELS = {
"best_practice": "GTFS Best Practices",
"realtime_reference": "GTFS-Realtime reference",
"reference": "GTFS Schedule reference",
"validator": "MobilityData GTFS Validator rules"
};
export const RULE_LINKS = {
"big_gap_in_service": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#big_gap_in_service-rule"
},
"equal_shape_distance_same_coordinates": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#equal_shape_distance_same_coordinates-rule"
},
"expired_calendar": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#expired_calendar-rule"
},
"fast_travel_between_consecutive_stops": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#fast_travel_between_consecutive_stops-rule"
},
"fast_travel_between_far_stops": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#fast_travel_between_far_stops-rule"
},
"feed_expiration_date30_days": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#feed_expiration_date30_days-rule"
},
"feed_expiration_date7_days": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#feed_expiration_date7_days-rule"
},
"invalid_currency_amount": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#invalid_currency_amount-rule"
},
"missing_feed_contact_email_and_url": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#missing_feed_contact_email_and_url-rule"
},
"missing_recommended_field": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#missing_recommended_field-rule"
},
"missing_recommended_file": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#missing_recommended_file-rule"
},
"missing_required_column": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#missing_required_column-rule"
},
"missing_timepoint_value": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#missing_timepoint_value-rule"
},
"mixed_case_recommended_field": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#mixed_case_recommended_field-rule"
},
"route_color_contrast": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#route_color_contrast-rule"
},
"scorecard_feed_expired": {
"authority": "GTFS Best Practices",
"canonical": null,
"kind": "best_practice",
"url": "https://gtfs.org/schedule/best-practices/#dataset-publishing-general-practices"
},
"scorecard_feed_expiring_soon": {
"authority": "GTFS Best Practices",
"canonical": null,
"kind": "best_practice",
"url": "https://gtfs.org/schedule/best-practices/#dataset-publishing-general-practices"
},
"scorecard_flex_no_booking_rules": {
"authority": "GTFS Schedule reference",
"canonical": null,
"kind": "reference",
"url": "https://gtfs.org/schedule/reference/#booking_rulestxt"
},
"scorecard_missing_feed_info_dates": {
"authority": "MobilityData GTFS Validator rules",
"canonical": "missing_feed_info_date",
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#missing_feed_info_date-rule"
},
"scorecard_missing_headsigns": {
"authority": "GTFS Best Practices",
"canonical": null,
"kind": "best_practice",
"url": "https://gtfs.org/schedule/best-practices/#tripstxt"
},
"scorecard_no_fare_data": {
"authority": "GTFS Best Practices",
"canonical": null,
"kind": "best_practice",
"url": "https://gtfs.org/schedule/best-practices/#fare_attributestxt"
},
"scorecard_no_feed_contact": {
"authority": "MobilityData GTFS Validator rules",
"canonical": "missing_feed_contact_email_and_url",
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#missing_feed_contact_email_and_url-rule"
},
"scorecard_rt_service_alerts_unreachable": {
"authority": "GTFS-Realtime reference",
"canonical": null,
"kind": "realtime_reference",
"url": "https://gtfs.org/documentation/realtime/reference/#message-alert"
},
"scorecard_rt_trip_coverage": {
"authority": "GTFS-Realtime reference",
"canonical": null,
"kind": "realtime_reference",
"url": "https://gtfs.org/documentation/realtime/reference/#message-tripupdate"
},
"scorecard_rt_trip_updates_unreachable": {
"authority": "GTFS-Realtime reference",
"canonical": null,
"kind": "realtime_reference",
"url": "https://gtfs.org/documentation/realtime/reference/#message-tripupdate"
},
"scorecard_rt_vehicle_positions_unreachable": {
"authority": "GTFS-Realtime reference",
"canonical": null,
"kind": "realtime_reference",
"url": "https://gtfs.org/documentation/realtime/reference/#message-vehicleposition"
},
"scorecard_station_no_pathways": {
"authority": "GTFS Schedule reference",
"canonical": null,
"kind": "reference",
"url": "https://gtfs.org/schedule/reference/#pathwaystxt"
},
"scorecard_stop_names_all_caps": {
"authority": "GTFS Best Practices",
"canonical": null,
"kind": "best_practice",
"url": "https://gtfs.org/schedule/best-practices/#stopstxt"
},
"scorecard_wheelchair_accessible_unknown": {
"authority": "GTFS Schedule reference",
"canonical": null,
"kind": "reference",
"url": "https://gtfs.org/schedule/reference/#tripstxt"
},
"scorecard_wheelchair_boarding_unknown": {
"authority": "GTFS Schedule reference",
"canonical": null,
"kind": "reference",
"url": "https://gtfs.org/schedule/reference/#stopstxt"
},
"service_has_no_active_day_of_the_week": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#service_has_no_active_day_of_the_week-rule"
},
"service_window_outside_feed_period": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#service_window_outside_feed_period-rule"
},
"stop_too_far_from_shape": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#stop_too_far_from_shape-rule"
},
"stop_too_far_from_shape_using_user_distance": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#stop_too_far_from_shape_using_user_distance-rule"
},
"stop_without_stop_time": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#stop_without_stop_time-rule"
},
"trip_coverage_not_active_for_next7_days": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#trip_coverage_not_active_for_next7_days-rule"
},
"trip_distance_exceeds_shape_distance_below_threshold": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#trip_distance_exceeds_shape_distance_below_threshold-rule"
},
"unknown_column": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#unknown_column-rule"
},
"unknown_file": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#unknown_file-rule"
},
"unused_shape": {
"authority": "MobilityData GTFS Validator rules",
"canonical": null,
"kind": "validator",
"url": "https://gtfs-validator.mobilitydata.org/rules.html#unused_shape-rule"
}
};
export const UNIVERSAL_GUIDANCE = {
"category_notes": {
"completeness": "GTFS Best Practices for rider-facing fields. MobilityData grading covers stop names and headsigns.",
"correctness": "GTFS Schedule best practices, checked by the MobilityData validator. MobilityData grading covers stop locations, route names, and colors. Google Transit requires a feed to pass validation for publication.",
"freshness": "GTFS Schedule best practices call for a dataset that stays current. An expired calendar can remove service from Google Transit and other rider trip planners.",
"realtime": "GTFS-Realtime best practices: a stable URL, high uptime, and frequent updates."
},
"name": "GTFS and rider-information guidance",
"note": "The scorecard is a data-quality lens, not a compliance determination. Its universal references describe good GTFS and useful rider information.",
"references": [
{
"name": "GTFS Schedule Best Practices",
"url": "https://gtfs.org/schedule/best-practices/"
},
{
"name": "GTFS-Realtime Best Practices",
"url": "https://gtfs.org/realtime/best-practices/"
},
{
"name": "MobilityData grading scheme",
"url": "https://github.com/MobilityData/gtfs-grading-scheme"
},
{
"name": "Google Transit publication guidance",
"url": "https://support.google.com/transitpartners/answer/1111481"
}
],
"scope": "all"
};
export const US_NTD_GUIDANCE = {
"category_notes": {
"correctness": "FTA NTD readiness also checks that the published feed is valid.",
"freshness": "FTA NTD readiness also checks that the published feed is current."
},
"kind": "requirement",
"name": "FTA National Transit Database GTFS requirement",
"note": "For US NTD reporters with qualifying service, the federal requirement calls for a public, valid, current GTFS feed and annual certification. For RY2026, the submission also needs a stable agency_id for each represented reporter, crosswalked to its NTD ID on P-50.",
"scope": "US",
"url": "https://www.transit.dot.gov/ntd"
};
export const JURISDICTION_GUIDANCE = {
"US-CA": {
"kind": "guideline",
"name": "California Transit Data Guidelines",
"note": "Caltrans' published quality guidelines and compliance checklist; this rubric is anchored to them.",
"scope": "US-CA",
"url": "https://dot.ca.gov/cal-itp/california-transit-data-guidelines"
}
};
export const SUPPORT_RESOURCES = {
"US-CO": {
"kind": "support",
"name": "CDOT Digital Transit Mobility",
"note": "Colorado's program coordinating GTFS data across transit providers.",
"scope": "US-CO",
"url": "https://www.codot.gov/programs/innovativemobility/mobility-technology/digital-transit-mobility"
},
"US-MI": {
"kind": "support",
"name": "Michigan Public Transit Open Data Program",
"note": "MDOT's program helping agencies produce and maintain GTFS and GTFS-Flex.",
"scope": "US-MI",
"url": "https://miruralmobility.org/"
},
"US-MN": {
"kind": "support",
"name": "MnDOT Transit",
"note": "Minnesota's statewide transit program and data resources.",
"scope": "US-MN",
"url": "https://www.dot.state.mn.us/transit/"
},
"US-OR": {
"kind": "support",
"name": "Oregon ODOT Public Transportation",
"note": "ODOT's Public Transportation Division, which supports statewide GTFS.",
"scope": "US-OR",
"url": "https://www.oregon.gov/odot/rptd/pages/index.aspx"
},
"US-WA": {
"kind": "support",
"name": "WSDOT Transportation Data",
"note": "WSDOT builds and publishes GTFS for Washington transit agencies.",
"scope": "US-WA",
"url": "https://wsdot.wa.gov/about/transportation-data"
}
};
export const US_STATE_SUBDIVISION_CODES = {
"California": "US-CA",
"Colorado": "US-CO",
"Michigan": "US-MI",
"Minnesota": "US-MN",
"Oregon": "US-OR",
"Washington": "US-WA"
};