Deltares / hydromt_delft3dfm

Delft3D FM plugin for HydroMT
https://deltares.github.io/hydromt_delft3dfm/
GNU General Public License v3.0
7 stars 1 forks source link

setup_network_parameters_from_rasters #42

Open xldeltares opened 1 year ago

xldeltares commented 1 year ago
@staticmethod
def setup_network_parameters_from_rasters(graph: GraphWrapper, dem_fn, landuse_fn, water_demand_fn, population_fn, building_footprint_fn, **kwargs) -> GraphWrapper:
    """
    This method sets up physical parameters of the urban drainage network represented by the graph, using various raster data sources.

    The method performs the following steps:
    1. Adds upstream and downstream street levels to the graph using a digital elevation model (DEM).
    2. Adds upstream areas to the graph using land use data.
    3. Adds water demand, population, and building footprint data to the graph using corresponding raster data sources.
    4. Approximates the size of the network based on the street size/type using data from the graph itself. --> use as weight for the next step.
    5. Approximates the slope of the network based on upstream and downstream street levels, the depths, and the length of the edge geometry in the graph. --> use as weight for the next step.

    Parameters:
    -----------
    graph: GraphWrapper
        The network graph to be filled with physical parameters. This is an instance of the GraphWrapper class, which wraps around the NetworkX Graph class.

    dem_fn: Union[str, Path]
        The file path to the digital elevation model (DEM) used to derive the upstream and downstream street levels.

    landuse_fn: Union[str, Path]
        The file path to the land use data used to derive the upstream area.

    water_demand_fn: Union[str, Path]
        The file path to the water demand data used to add water demand information to the graph.

    population_fn: Union[str, Path]
        The file path to the population data used to add population information to the graph.

    building_footprint_fn: Union[str, Path]
        The file path to the building footprint data used to add building footprint information to the graph.

    **kwargs:
         Additional keyword arguments for more specific implementations of the function.

    Returns:
    --------
    GraphWrapper:
        The updated graph, an instance of GraphWrapper class, representing the urban drainage network with physical parameters filled in.
    """
    # method implementation goes here
    pass
xldeltares commented 1 year ago

Discussed with Helene: Make use of the function ds.raster.sample(gdf of nodes) For now support points (with window is also possible) and polygons.

This function can be generalised, similar to setup_mesh_from_maps.