floodresilience.tables

This script contains SQLAlchemy models for FReDT database tables and utility functions for database operations.

Classes

RiverNetworkExclusions

Class representing the 'rec_network_exclusions' table.

RiverNetwork

Class representing the 'rec_network' table.

BGFloodModelOutput

Class representing the 'bg_flood_model_output' table.

BuildingFloodStatus

Class representing the 'building_flood_status' table.

Module Contents

class floodresilience.tables.RiverNetworkExclusions

Bases: src.digitaltwin.tables.Base

Class representing the ‘rec_network_exclusions’ table.

__tablename__

Name of the database table.

Type:

str

rec_network_id

An identifier for the river network associated with each new run.

Type:

int

objectid

An identifier for the REC river object matching from the ‘rec_data’ table.

Type:

int

exclusion_cause

Cause of exclusion, i.e., the reason why the REC river geometry was excluded.

Type:

str

geometry

Geometric representation of the excluded REC river features.

Type:

LineString

__tablename__ = 'rec_network_exclusions'
rec_network_id
objectid
exclusion_cause
geometry
__table_args__
class floodresilience.tables.RiverNetwork

Bases: src.digitaltwin.tables.Base

Class representing the ‘rec_network’ table.

__tablename__

Name of the database table.

Type:

str

rec_network_id

An identifier for the river network associated with each new run (primary key).

Type:

int

network_path

Path to the REC river network file.

Type:

str

network_data_path

Path to the REC river network data file for the AOI.

Type:

str

created_at

Timestamp indicating when the output was created.

Type:

datetime

geometry

Geometric representation of the catchment area coverage.

Type:

Polygon

__tablename__ = 'rec_network'
rec_network_id
network_path
network_data_path
created_at
geometry
class floodresilience.tables.BGFloodModelOutput

Bases: src.digitaltwin.tables.Base

Class representing the ‘bg_flood_model_output’ table.

__tablename__

Name of the database table.

Type:

str

unique_id

Unique identifier for each entry (primary key).

Type:

int

file_name

Name of the flood model output file.

Type:

str

file_path

Path to the flood model output file.

Type:

str

created_at

Timestamp indicating when the output was created.

Type:

datetime

geometry

Geometric representation of the catchment area coverage.

Type:

Polygon

__tablename__ = 'bg_flood_model_output'
unique_id
file_name
file_path
created_at
geometry
class floodresilience.tables.BuildingFloodStatus

Bases: src.digitaltwin.tables.Base

Class representing the ‘building_flood_status’ table. Represents if a building is flooded for a given flood model output

__tablename__

Name of the database table.

Type:

str

unique_id

Unique identifier for each entry (primary key).

Type:

int

building_outline_id

Foreign key building outline id matching from nz_building_outlines table

Type:

int

is_flooded

If the building is flooded or not

Type:

bool

flood_model_id

Foreign key mathing the unique_id from bg_flood_model_output table

Type:

int.

__tablename__ = 'building_flood_status'
unique_id
building_outline_id
is_flooded
flood_model_id