Commit 449b89a6 authored by Danijel Schorlemmer's avatar Danijel Schorlemmer
Browse files

Implemented the import of dwelling floorspace and sizes

parent 6b1a2a65
Pipeline #21766 passed with stage
in 1 minute and 30 seconds
......@@ -74,11 +74,16 @@ class JapanDatabase(SpatialiteDatabase):
construction material and number of stories for each district
HouseholdData : Stores different parameters describing the household numbers,
household members, and household spaces for each district
DwellingFloorspace : Stores the floorspace per dwelling depending on the building,
dwelling, tenure types and construction material
DwellingDistribution: Stores the number of dwellings of different sizes depending on
the building, dwelling, tenure types and construction material
BuildingType : Stores the different types of buildings
DwellingType : Stores the different types of dwellings
TenureType : Stores the different types of tenures
ConstructionMaterial: Stores the construction-material types
StoryNumber : Stores the classifications of numbers of stories
DwellingSizeType : Stores the different types of dwelling sizes
"""
# Create table District
......@@ -132,35 +137,70 @@ class JapanDatabase(SpatialiteDatabase):
self.connection.execute(sql_statement)
logger.debug("Table HouseholdData created")
# Create table DwellingFloorspace
sql_statement = "CREATE TABLE DwellingFloorspace ("
sql_statement += "id INTEGER PRIMARY KEY, "
sql_statement += "building_type_id INTEGER, "
sql_statement += "dwelling_type_id INTEGER, "
sql_statement += "tenure_type_id INTEGER, "
sql_statement += "construction_material_id INTEGER, "
sql_statement += "floorspace REAL)"
self.connection.execute(sql_statement)
logger.debug("Table DwellingFloorspace created")
# Create table DwellingDistribution
sql_statement = "CREATE TABLE DwellingDistribution ("
sql_statement += "id INTEGER PRIMARY KEY, "
sql_statement += "building_type_id INTEGER, "
sql_statement += "dwelling_type_id INTEGER, "
sql_statement += "tenure_type_id INTEGER, "
sql_statement += "construction_material_id INTEGER, "
sql_statement += "dwelling_size_id INTEGER, "
sql_statement += "number_dwelling REAL)"
self.connection.execute(sql_statement)
logger.debug("Table DwellingDistribution created")
# Create table BuildingType
sql_statement = "CREATE TABLE BuildingType ("
sql_statement += "id INTEGER PRIMARY KEY, "
sql_statement += "description TEXT)"
self.connection.execute(sql_statement)
logger.debug("Table BuildingType created")
# Create table DwellingType
sql_statement = "CREATE TABLE DwellingType ("
sql_statement += "id INTEGER PRIMARY KEY, "
sql_statement += "description TEXT)"
self.connection.execute(sql_statement)
logger.debug("Table DwellingType created")
# Create table TenureType
sql_statement = "CREATE TABLE TenureType ("
sql_statement += "id INTEGER PRIMARY KEY, "
sql_statement += "description TEXT)"
self.connection.execute(sql_statement)
logger.debug("Table TenureType created")
# Create table ConstructionMaterial
sql_statement = "CREATE TABLE ConstructionMaterial ("
sql_statement += "id INTEGER PRIMARY KEY, "
sql_statement += "description TEXT)"
self.connection.execute(sql_statement)
logger.debug("Table ConstructionMaterial created")
# Create table NumberStories
# Create table StoryNumber
sql_statement = "CREATE TABLE StoryNumber ("
sql_statement += "id INTEGER PRIMARY KEY, "
sql_statement += "description TEXT)"
self.connection.execute(sql_statement)
logger.debug("Table StoryNumber created")
# Create table DwellingSizeType
sql_statement = "CREATE TABLE DwellingSizeType ("
sql_statement += "id INTEGER PRIMARY KEY, "
sql_statement += "description TEXT)"
self.connection.execute(sql_statement)
logger.debug("Table DwellingSizeType created")
def insert_district(self, admin_id, admin_name, geom):
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment