Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 5 Next »

De hoogte van de gridcellen kan worden afgeleid uit een maaiveldhoogteraster via de functie ‘mesh2d_altitude_from_raster’:

def mesh2d_altitude_from_raster(
    network,
    rasterpath,
    where: RasterStatPosition = "face",
    stat="mean",
    fill_option: FillOption = "fill_value",
    fill_value=None,
):
    """
    Method to determine level of nodes

    This function works faster for large amounts of cells, since it does not
    draw polygons but checks for nearest neighbours (voronoi) based
    on interpolation.

    Note that the raster is not clipped. Any values outside the bounds are
    also taken into account.
    
    Arguments:
      network: network object containing the mesh
      rasterpath: path to the rasterfile containing elevations
      where: 'face' or 'node'; default = face
      stat: rasterstat statistic to be used (default = mean)
      fill_option: "fill-value", 'nearest', or 'interpolate'. Fill missing cells with a constant value, by nearest-neighbour interpolation, or by linear interpolation.
      fill_value: value to fill missing cells with (also needed for interpolation in case that fails)
    """

Een voorbeeld van een toepassing wordt hieronder getoond. De gemiddelde hoogte van een gridcell wordt toegekend aan de mesh ‘faces’. Waar data mist, wordt 15 m ingevuld.

mesh.mesh2d_altitude_from_raster(network, "../tests/data/rasters/AHN_2m_clipped_filled.tif", "face", "mean", fill_value=15)

Merk op dat de keuze voor de hoogtebepaling op de nodes of faces niet los gezien kan worden van de rekeninstellingen in het mdu-bestand. Zie (op het moment van schrijven) paragraaf 8.4.2.3 - “Conveyance in 2D” en paragraaf 8.8.1 - “Definitions” in de handleiding.

  • No labels