utils.hifld_utils
Module for parsing Homeland infrastructure foundation level-data.
Idea is to take the bounding box and find the subset of infrastructure in that region.
get_relationship_between_hifld_infrastructures(hifld_data_csv, unique_id_column, load_csv, bus_csv, output_csv_path, distance_threshold=2000.0)
Creates a relationship between consumers and HIFLD infrastructures.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hifld_data_csv |
str
|
Path to filtered HIFLD data csv file |
required |
unique_id_column |
List
|
Column name used as identifier for critical infrastructures |
required |
load_csv |
str
|
Path to load csv file |
required |
bus_csv |
str
|
Path to bus csv file |
required |
output_csv_path |
str
|
output csv path for storing relationship csv |
required |
distance_threshold |
float
|
Distance threshold used for mapping customer to critical infrastructure |
2000.0
|
Source code in erad\utils\hifld_utils.py
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 |
|
get_subset_of_hifld_data(csv_file, bounds, output_folder, logitude_column_name='X', latitude_column_name='Y', columns_to_keep=['X', 'Y'], name_of_csv_file=None)
Extracts a subset of HIFLD data set.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
csv_file |
str
|
Path to HIFLD data csv file |
required |
bounds |
List
|
Bounding box coordinates |
required |
output_folder |
str
|
Path to output folder |
required |
logitude_column_name |
str
|
Expects column with name 'X' |
'X'
|
latitude_column_name |
str
|
Expects column with name 'Y' |
'Y'
|
columns_to_keep |
List
|
List of column names to keep by default keeps all of them |
['X', 'Y']
|
name_of_csv_file (Union[str, None]): Name of csv file to export filtered set
Source code in erad\utils\hifld_utils.py
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 |
|