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

Feat: Onboard NHTSA Traffic Fatalities dataset #454

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
}
28 changes: 28 additions & 0 deletions datasets/nhtsa_traffic_fatalities/infra/provider.tf
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
}
26 changes: 26 additions & 0 deletions datasets/nhtsa_traffic_fatalities/infra/variables.tf
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 = {}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

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"
}
]
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"
}
]
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"
}
]
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"
}
]
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"
}
]
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"
}
]