-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Onboard NHTSA Traffic Fatalities dataset (#454)
- Loading branch information
1 parent
f39a177
commit eb409c4
Showing
42 changed files
with
24,278 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
datasets/nhtsa_traffic_fatalities/infra/nhtsa_traffic_fatalities_dataset.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
|
||
resource "google_bigquery_dataset" "nhtsa_traffic_fatalities" { | ||
dataset_id = "nhtsa_traffic_fatalities" | ||
project = var.project_id | ||
} | ||
|
||
output "bigquery_dataset-nhtsa_traffic_fatalities-dataset_id" { | ||
value = google_bigquery_dataset.nhtsa_traffic_fatalities.dataset_id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
|
||
provider "google" { | ||
project = var.project_id | ||
impersonate_service_account = var.impersonating_acct | ||
region = var.region | ||
} | ||
|
||
data "google_client_openid_userinfo" "me" {} | ||
|
||
output "impersonating-account" { | ||
value = data.google_client_openid_userinfo.me.email | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
|
||
variable "project_id" {} | ||
variable "bucket_name_prefix" {} | ||
variable "impersonating_acct" {} | ||
variable "region" {} | ||
variable "env" {} | ||
variable "iam_policies" { | ||
default = {} | ||
} | ||
|
542 changes: 542 additions & 0 deletions
542
...a_traffic_fatalities/pipelines/_images/nhtsa_traffic_fatalities_accident_2015_schema.json
Large diffs are not rendered by default.
Oops, something went wrong.
554 changes: 554 additions & 0 deletions
554
...ffic_fatalities/pipelines/_images/nhtsa_traffic_fatalities_accident_2016_2019_schema.json
Large diffs are not rendered by default.
Oops, something went wrong.
494 changes: 494 additions & 0 deletions
494
...a_traffic_fatalities/pipelines/_images/nhtsa_traffic_fatalities_accident_2020_schema.json
Large diffs are not rendered by default.
Oops, something went wrong.
80 changes: 80 additions & 0 deletions
80
...raffic_fatalities/pipelines/_images/nhtsa_traffic_fatalities_cevent_2015_2020_schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
[ | ||
{ | ||
"name": "state_number", | ||
"type": "integer", | ||
"description": "This data element identifies the state in which the crash occurred. The codes are from the General Services Administration’s (GSA) publication of worldwide Geographic Location Codes (GLC). For more info on the codes, please look at <C1/V1/D1/PC1/P1/NM1 State Number> section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "state_name", | ||
"type": "string", | ||
"description": "This data element identifies the state in which the crash occurred. The codes are from the General Services Administration’s (GSA) publication of worldwide Geographic Location Codes (GLC).", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "consecutive_number", | ||
"type": "integer", | ||
"description": "This data element is the unique case number assigned to each crash. It appears on each data file and is used to merge information from the data files together. xxxxxx Two Characters for State Code followed by Four Characters for Case Number", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "event_number", | ||
"type": "integer", | ||
"description": "This data element is the consecutive number assigned to each harmful and nonharmful event in a crash, in chronological order. 001-999 Event Number", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "vehicle_number_this_vehicle", | ||
"type": "integer", | ||
"description": "This data element identifies the “Vehicle Number” (VEH_NO) of this in-transport motor vehicle described in this event. 1-999 Vehicle Number", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "area_of_impact_this_vehicle", | ||
"type": "integer", | ||
"description": "This data element identifies the impact point, if any, on this in-transport motor vehicle that produced property damage or personal injury in this event. For more info on the codes, please look at <C18 Area of Impact (This Vehicle)> section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "area_of_impact_this_vehicle_name", | ||
"type": "string", | ||
"description": "This data element identifies the impact point, if any, on this in-transport motor vehicle that produced property damage or personal injury in this event.", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "sequence_of_events", | ||
"type": "integer", | ||
"description": "This data element describes this event. A motor vehicle traffic crash is a series of events resulting from an unstabilized situation. This series of harmful and non-harmful events is recorded in chronological order based on the PAR narrative and diagram. For more info on the codes, please look at <V31 Sequence of Events> section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "sequence_of_events_name", | ||
"type": "string", | ||
"description": "This data element describes this event. A motor vehicle traffic crash is a series of events resulting from an unstabilized situation. This series of harmful and non-harmful events is recorded in chronological order based on the PAR narrative and diagram.", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "vehicle_number_other_vehicle", | ||
"type": "integer", | ||
"description": "This data element identifies the “Vehicle Number” (VEH_NO) of the other motor vehicle, if any, in this event. 1-999 Vehicle Number 5555 Non-Harmful Event 9999 Not a Motor Vehicle", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "vehicle_number_other_vehicle_name", | ||
"type": "string", | ||
"description": "This data element identifies the “Vehicle Number” (VEH_NO) of the other motor vehicle, if any, in this event. 1-999 Vehicle Number 5555 Non-Harmful Event 9999 Not a Motor Vehicle", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "area_of_impact_other_vehicle", | ||
"type": "string", | ||
"description": "This data element identifies the impact point on the other motor vehicle, if any, in this event. For more info on the codes, please look at <C18 Area of Impact (Other Vehicle)> section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "area_of_impact_other_vehicle_name", | ||
"type": "string", | ||
"description": "This data element identifies the impact point on the other motor vehicle, if any, in this event.", | ||
"mode": "NULLABLE" | ||
} | ||
] |
38 changes: 38 additions & 0 deletions
38
...raffic_fatalities/pipelines/_images/nhtsa_traffic_fatalities_damage_2015_2020_schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[ | ||
{ | ||
"name": "state_number", | ||
"type": "integer", | ||
"description": "This data element identifies the state in which the crash occurred. The codes are from the General Services Administration’s (GSA) publication of worldwide Geographic Location Codes (GLC). For more info on the codes, please look at <C1/V1/D1/PC1/P1/NM1 State Number> section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "state_name", | ||
"type": "string", | ||
"description": "This data element identifies the state in which the crash occurred. The codes are from the General Services Administration’s (GSA) publication of worldwide Geographic Location Codes (GLC).", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "consecutive_number", | ||
"type": "integer", | ||
"description": "This data element is the unique case number assigned to each crash. It appears on each data file and is used to merge information from the data files together. xxxxxx Two Characters for State Code followed by Four Characters for Case Number", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "vehicle_number", | ||
"type": "integer", | ||
"description": "This data element is the consecutive number assigned to each vehicle in the case. This data element appears on each vehicle level data file and is used in conjunction with the ST_CASE data element to merge information from vehicle level data files. 000-999 Assigned Number of Motor Vehicle", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "damaged_areas", | ||
"type": "integer", | ||
"description": "This data element identifies all the areas on this vehicle that were damaged in the crash as reflected in the case materials. 1-12 Clock points 13 Top 14 Undercarriage 15 No Damage 99 Unknown", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "damaged_areas_name", | ||
"type": "string", | ||
"description": "This data element identifies all the areas on this vehicle that were damaged in the crash as reflected in the case materials.", | ||
"mode": "NULLABLE" | ||
} | ||
] |
38 changes: 38 additions & 0 deletions
38
...ffic_fatalities/pipelines/_images/nhtsa_traffic_fatalities_distract_2015_2020_schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[ | ||
{ | ||
"name": "state_number", | ||
"type": "integer", | ||
"description": "This data element identifies the state in which the crash occurred. The codes are from the General Services Administration’s (GSA) publication of worldwide Geographic Location Codes (GLC). For more info on the codes, please look at <C1/V1/D1/PC1/P1/NM1 State Number> section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "state_name", | ||
"type": "string", | ||
"description": "This data element identifies the state in which the crash occurred. The codes are from the General Services Administration’s (GSA) publication of worldwide Geographic Location Codes (GLC).", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "consecutive_number", | ||
"type": "integer", | ||
"description": "This data element is the unique case number assigned to each crash. It appears on each data file and is used to merge information from the data files together. xxxxxx Two Characters for State Code followed by Four Characters for Case Number", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "vehicle_number", | ||
"type": "integer", | ||
"description": "This data element is the consecutive number assigned to each vehicle in the case. This data element appears on each vehicle level data file and is used in conjunction with the ST_CASE data element to merge information from vehicle level data files. 000-999 Assigned Number of Motor Vehicle", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "driver_distracted_by", | ||
"type": "integer", | ||
"description": "This data element identifies the attribute(s) which best describe this driver’s attention to driving prior to the driver’s realization of an impending critical event or just prior to impact if realization of an impending critical event does not occur. For more info on the codes, please look at <PC16 Driver Distracted By> section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "driver_distracted_by_name", | ||
"type": "string", | ||
"description": "This data element identifies the attribute(s) which best describe this driver’s attention to driving prior to the driver’s realization of an impending critical event or just prior to impact if realization of an impending critical event does not occur.", | ||
"mode": "NULLABLE" | ||
} | ||
] |
38 changes: 38 additions & 0 deletions
38
...ffic_fatalities/pipelines/_images/nhtsa_traffic_fatalities_drimpair_2015_2020_schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[ | ||
{ | ||
"name": "state_number", | ||
"type": "integer", | ||
"description": "This data element identifies the state in which the crash occurred. The codes are from the General Services Administration’s (GSA) publication of worldwide Geographic Location Codes (GLC). For more info on the codes, please look at <C1/V1/D1/PC1/P1/NM1 State Number> section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "state_name", | ||
"type": "string", | ||
"description": "This data element identifies the state in which the crash occurred. The codes are from the General Services Administration’s (GSA) publication of worldwide Geographic Location Codes (GLC).", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "consecutive_number", | ||
"type": "integer", | ||
"description": "This data element is the unique case number assigned to each crash. It appears on each data file and is used to merge information from the data files together. xxxxxx Two Characters for State Code followed by Four Characters for Case Number", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "vehicle_number", | ||
"type": "integer", | ||
"description": "This data element is the consecutive number assigned to each vehicle in the case. This data element appears on each vehicle level data file and is used in conjunction with the ST_CASE data element to merge information from vehicle level data files. 000-999 Assigned Number of Motor Vehicle", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "condition_impairment_at_time_of_crash_driver", | ||
"type": "integer", | ||
"description": "This data element identifies physical impairments to this driver that may have contributed to the crash as identified by law enforcement. For more info on the codes, please look at <D23 Condition (Impairment) at Time of Crash- Driver> section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "condition_impairment_at_time_of_crash_driver_name", | ||
"type": "string", | ||
"description": "This data element identifies physical impairments to this driver that may have contributed to the crash as identified by law enforcement.", | ||
"mode": "NULLABLE" | ||
} | ||
] |
38 changes: 38 additions & 0 deletions
38
...raffic_fatalities/pipelines/_images/nhtsa_traffic_fatalities_factor_2015_2020_schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[ | ||
{ | ||
"name": "state_number", | ||
"type": "integer", | ||
"description": "This data element identifies the state in which the crash occurred. The codes are from the General Services Administration’s (GSA) publication of worldwide Geographic Location Codes (GLC). For more info on the codes, please look at <C1/V1/D1/PC1/P1/NM1 State Number> section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "state_name", | ||
"type": "string", | ||
"description": "This data element identifies the state in which the crash occurred. The codes are from the General Services Administration’s (GSA) publication of worldwide Geographic Location Codes (GLC).", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "consecutive_number", | ||
"type": "integer", | ||
"description": "This data element is the unique case number assigned to each crash. It appears on each data file and is used to merge information from the data files together. xxxxxx Two Characters for State Code followed by Four Characters for Case Number", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "vehicle_number", | ||
"type": "integer", | ||
"description": "This data element is the consecutive number assigned to each vehicle in the case. This data element appears on each vehicle level data file and is used in conjunction with the ST_CASE data element to merge information from vehicle level data files. 000-999 Assigned Number of Motor Vehicle", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "contributing_circumstances_motor_vehicle", | ||
"type": "integer", | ||
"description": "This data element describes this vehicle’s possible pre-existing defects or maintenance conditions that may have contributed to the crash. For more info on the codes, please look at <PC4 Contributing Circumstances, Motor Vehicle> section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "contributing_circumstances_motor_vehicle_name", | ||
"type": "string", | ||
"description": "This data element describes this vehicle’s possible pre-existing defects or maintenance conditions that may have contributed to the crash.", | ||
"mode": "NULLABLE" | ||
} | ||
] |
38 changes: 38 additions & 0 deletions
38
...ffic_fatalities/pipelines/_images/nhtsa_traffic_fatalities_maneuver_2015_2020_schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[ | ||
{ | ||
"name": "state_number", | ||
"type": "integer", | ||
"description": "This data element identifies the state in which the crash occurred. The codes are from the General Services Administration’s (GSA) publication of worldwide Geographic Location Codes (GLC). For more info on the codes, please look at <C1/V1/D1/PC1/P1/NM1 State Number> section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "state_name", | ||
"type": "string", | ||
"description": "This data element identifies the state in which the crash occurred. The codes are from the General Services Administration’s (GSA) publication of worldwide Geographic Location Codes (GLC).", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "consecutive_number", | ||
"type": "integer", | ||
"description": "This data element is the unique case number assigned to each crash. It appears on each data file and is used to merge information from the data files together. xxxxxx Two Characters for State Code followed by Four Characters for Case Number", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "vehicle_number", | ||
"type": "integer", | ||
"description": "This data element is the consecutive number assigned to each vehicle in the case. This data element appears on each vehicle level data file and is used in conjunction with the ST_CASE data element to merge information from vehicle level data files. 000-999 Assigned Number of Motor Vehicle", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "driver_maneuvered_to_avoid", | ||
"type": "integer", | ||
"description": "This data element identifies the thing(s) this driver attempted to avoid while the vehicle was on the road portion of the trafficway, just prior to the first harmful event for this vehicle. For more info on the codes, please look at <PC15 Driver Maneuvered to Avoid> section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315", | ||
"mode": "NULLABLE" | ||
}, | ||
{ | ||
"name": "driver_maneuvered_to_avoid_name", | ||
"type": "string", | ||
"description": "This data element identifies the thing(s) this driver attempted to avoid while the vehicle was on the road portion of the trafficway, just prior to the first harmful event for this vehicle.", | ||
"mode": "NULLABLE" | ||
} | ||
] |
Oops, something went wrong.