Identifies and masks the top or bottom quantile of elevation values within a given polygon overlaying a digital elevation model (DEM).
Arguments
- dem
A
SpatRasterobject representing a digital elevation model (DEM).- runout_ply
A
SpatVectorpolygon (or compatibleSpatialPolygons*object) defining the area from which to extract elevation values.- quant
A numeric value between 0 and 1 indicating the proportion (quantile) of elevation values to extract. Defaults to 0.05 (top/bottom 5%).
- upper
Logical. If
TRUE, the function selects the highest elevation percentile; ifFALSE, it selects the lowest. Defaults toTRUE.