src.dynamic_boundary_conditions.river.river_data_to_from_db
This script handles storing REC data in the database, and retrieving REC data enriched with sea-draining catchment information from the database.
Attributes
Functions
|
Store REC data in the database. |
|
Retrieve sea-draining catchment data from the database that intersects with the given catchment area. |
|
Retrieve REC data from the database for the specified catchment area with an additional column that identifies |
Module Contents
- src.dynamic_boundary_conditions.river.river_data_to_from_db.log
- src.dynamic_boundary_conditions.river.river_data_to_from_db.store_rec_data_to_db(engine: sqlalchemy.engine.Engine) None
Store REC data in the database.
- Parameters:
engine (Engine) – The engine used to connect to the database.
- Returns:
This function does not return any value.
- Return type:
None
- src.dynamic_boundary_conditions.river.river_data_to_from_db.get_sdc_data_from_db(engine: sqlalchemy.engine.Engine, catchment_area: geopandas.GeoDataFrame) geopandas.GeoDataFrame
Retrieve sea-draining catchment data from the database that intersects with the given catchment area.
- Parameters:
engine (Engine) – The engine used to connect to the database.
catchment_area (gpd.GeoDataFrame) – A GeoDataFrame representing the catchment area.
- Returns:
A GeoDataFrame containing sea-draining catchment data that intersects with the given catchment area.
- Return type:
gpd.GeoDataFrame
- src.dynamic_boundary_conditions.river.river_data_to_from_db.get_rec_data_with_sdc_from_db(engine: sqlalchemy.engine.Engine, catchment_area: geopandas.GeoDataFrame, river_network_id: int) geopandas.GeoDataFrame
Retrieve REC data from the database for the specified catchment area with an additional column that identifies the associated sea-draining catchment for each REC geometry. Simultaneously, identify the REC geometries that do not fully reside within sea-draining catchments and proceed to add these excluded REC geometries to the appropriate database table.
- Parameters:
engine (Engine) – The engine used to connect to the database.
catchment_area (gpd.GeoDataFrame) – A GeoDataFrame representing the catchment area.
river_network_id (int) – An identifier for the river network associated with the current run.
- Returns:
A GeoDataFrame containing the retrieved REC data for the specified catchment area with an additional column that identifies the associated sea-draining catchment for each REC geometry.
- Return type:
gpd.GeoDataFrame