src.dynamic_boundary_conditions.tide.tide_query_location
Get the locations used to fetch tide data from NIWA using the tide API.
Attributes
Exceptions
Exception raised when no tide data is to be used for the BG-Flood model. |
Functions
Retrieve regional council clipped data from the database based on the catchment area. |
|
|
Retrieve the New Zealand coastline data within a specified distance of the catchment area from the database. |
|
Get information about the boundary segments of the catchment area. |
|
Get the boundary lines of the catchment area. |
|
Get the centroids of the boundary lines of the catchment area. |
Determine the positions of non-intersection centroid points relative to the boundary lines of the catchment area. |
|
|
Get the locations used to fetch tide data from NIWA using the tide API. |
Module Contents
- src.dynamic_boundary_conditions.tide.tide_query_location.log
- exception src.dynamic_boundary_conditions.tide.tide_query_location.NoTideDataException
Bases:
Exception
Exception raised when no tide data is to be used for the BG-Flood model.
- src.dynamic_boundary_conditions.tide.tide_query_location.get_regional_council_clipped_from_db(engine: sqlalchemy.engine.Engine, catchment_area: geopandas.GeoDataFrame) geopandas.GeoDataFrame
Retrieve regional council clipped data from the database based on the 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 the regional council clipped data for the catchment area.
- Return type:
gpd.GeoDataFrame
- src.dynamic_boundary_conditions.tide.tide_query_location.get_nz_coastline_from_db(engine: sqlalchemy.engine.Engine, catchment_area: geopandas.GeoDataFrame, distance_km: int = 1) geopandas.GeoDataFrame
Retrieve the New Zealand coastline data within a specified distance of the catchment area from the database.
- Parameters:
engine (Engine) – The engine used to connect to the database.
catchment_area (gpd.GeoDataFrame) – A GeoDataFrame representing the catchment area.
distance_km (int = 1) – Distance in kilometers used to buffer the catchment area for coastline retrieval. Default is 1 kilometer.
- Returns:
A GeoDataFrame containing the New Zealand coastline data within the specified distance of the catchment area.
- Return type:
gpd.GeoDataFrame
- src.dynamic_boundary_conditions.tide.tide_query_location.get_catchment_boundary_info(catchment_area: geopandas.GeoDataFrame) geopandas.GeoDataFrame
Get information about the boundary segments of the catchment area.
- Parameters:
catchment_area (gpd.GeoDataFrame) – A GeoDataFrame representing the catchment area.
- Returns:
A GeoDataFrame containing information about the boundary segments of the catchment area.
- Return type:
gpd.GeoDataFrame
- Raises:
ValueError – If the position of a catchment boundary line cannot be identified.
- src.dynamic_boundary_conditions.tide.tide_query_location.get_catchment_boundary_lines(catchment_area: geopandas.GeoDataFrame) geopandas.GeoDataFrame
Get the boundary lines of the catchment area.
- Parameters:
catchment_area (gpd.GeoDataFrame) – A GeoDataFrame representing the catchment area.
- Returns:
A GeoDataFrame containing the boundary lines of the catchment area.
- Return type:
gpd.GeoDataFrame
- src.dynamic_boundary_conditions.tide.tide_query_location.get_catchment_boundary_centroids(catchment_area: geopandas.GeoDataFrame) geopandas.GeoDataFrame
Get the centroids of the boundary lines of the catchment area.
- Parameters:
catchment_area (gpd.GeoDataFrame) – A GeoDataFrame representing the catchment area.
- Returns:
A GeoDataFrame containing the centroids of the boundary lines of the catchment area.
- Return type:
gpd.GeoDataFrame
- src.dynamic_boundary_conditions.tide.tide_query_location.get_non_intersection_centroid_position(catchment_area: geopandas.GeoDataFrame, non_intersection_area: geopandas.GeoDataFrame) geopandas.GeoDataFrame
Determine the positions of non-intersection centroid points relative to the boundary lines of the catchment area.
- Parameters:
catchment_area (gpd.GeoDataFrame) – A GeoDataFrame representing the catchment area.
non_intersection_area (gpd.GeoDataFrame) – A GeoDataFrame representing the non-intersection area.
- Returns:
A GeoDataFrame containing the positions of non-intersection centroid points relative to the catchment boundary lines. The GeoDataFrame includes the ‘position’ column denoting the relative position and the ‘geometry’ column representing the centroid points of the non-intersection areas.
- Return type:
gpd.GeoDataFrame
- src.dynamic_boundary_conditions.tide.tide_query_location.get_tide_query_locations(engine: sqlalchemy.engine.Engine, catchment_area: geopandas.GeoDataFrame, distance_km: int = 1) geopandas.GeoDataFrame
Get the locations used to fetch tide data from NIWA using the tide API.
- Parameters:
engine (Engine) – The engine used to connect to the database.
catchment_area (gpd.GeoDataFrame) – A GeoDataFrame representing the catchment area.
distance_km (int = 1) – Distance in kilometers used to buffer the catchment area for coastline retrieval. Default is 1 kilometer.
- Returns:
A GeoDataFrame containing the locations used to fetch tide data from NIWA using the tide API.
- Return type:
gpd.GeoDataFrame
- Raises:
NoTideDataException – If no coastline is found within the specified distance of the catchment area.