diff --git a/exposurejapan/commercial.py b/exposurejapan/commercial.py index 11c0b6f64f247b4621d801896a7b3ea3b201eab4..f6ee85f8740a7242276260619d2ff829f6bef407 100644 --- a/exposurejapan/commercial.py +++ b/exposurejapan/commercial.py @@ -500,7 +500,7 @@ class CommercialAggregatedExposure(SpatialiteDatabase): # Get ID of construction material if row["construction_material"] == "Unknown": - construction_material_id = constants.TOTAL + construction_material_id = constants.UNKNOWN else: construction_material_id = add_element_and_get_index( row["construction_material"], construction_material_list @@ -508,7 +508,7 @@ class CommercialAggregatedExposure(SpatialiteDatabase): # Get ID of basement presence type if row["presence_or_absence_basement"] == "Unknown": - basement_presence_id = constants.TOTAL + basement_presence_id = constants.UNKNOWN else: basement_presence_id = add_element_and_get_index( row["presence_or_absence_basement"], basement_presence_list @@ -516,7 +516,7 @@ class CommercialAggregatedExposure(SpatialiteDatabase): # Get ID of earthquake resistance code presence type if row["earthquake_resistance_std"] == "Unknown": - eq_resistance_code_presence_id = constants.TOTAL + eq_resistance_code_presence_id = constants.UNKNOWN else: eq_resistance_code_presence_id = add_element_and_get_index( row["earthquake_resistance_std"], eq_resistance_code_presence_list @@ -524,7 +524,7 @@ class CommercialAggregatedExposure(SpatialiteDatabase): # Get ID of total floor area (in square meters) range if row["total_floor_area"] == "Unknown": - total_floor_area_id = constants.TOTAL + total_floor_area_id = constants.UNKNOWN else: total_floor_area_id = add_element_and_get_index( row["total_floor_area"], total_floor_area_list diff --git a/exposurejapan/constants.py b/exposurejapan/constants.py index e1e6b8664deff9d7ce8a1f98f56116399becc42b..1d0afcf99045188fafcbb09ad2112964775a63b2 100644 --- a/exposurejapan/constants.py +++ b/exposurejapan/constants.py @@ -108,3 +108,6 @@ NUMBER_DWELLING_SIZES = 6 # Constant numbers for import of dwelling-size data to DwellingFloorspace table FLOORSPACE_PER_DWELLING_DWELLING_SIZES = 13 + +# Constant number for Unknown values while importing commercial building numbers data +UNKNOWN = -1