Create a Landscape with Diffuse Vegetation Boundary
Source:R/landscape_create_diffuse.R
create_landscape_diffuse.RdGenerates a binary landscape with a diffuse vegetation boundary where vegetation probability decreases with distance.
Usage
create_landscape_diffuse(
width = 100,
height = 100,
boundary_position = 0.2,
steepness = 0.5,
rotation = 0
)Arguments
- width
Integer. Width of the landscape in pixels (default: 100).
- height
Integer. Height of the landscape in pixels (default: 100).
- boundary_position
Numeric. Relative position of vegetation boundary from top (0-1) (default: 0.5).
- steepness
Numeric. Controls the transition gradient (0-1). Lower values (e.g., 0.1) create sharper transitions. Higher values (e.g., 0.9) create more gradual, diffuse transitions where vegetation probability persists further below the vegetation boundary (default: 0.5).
- rotation
Numeric. Angle to rotate landscape in degrees (default: 0).
Value
A landscape object with pattern "diffuse" containing:
- data
SpatRaster with binary values (0 = bare ground, 1 = vegetation)
- pattern
Character string "diffuse"
- params
List of all input parameters used to generate the landscape
See also
Other landscape creation:
create_landscape(),
create_landscape_bands(),
create_landscape_bare(),
create_landscape_clustered(),
create_landscape_dense(),
create_landscape_fingers(),
create_landscape_gaps(),
create_landscape_labyrinth(),
create_landscape_random(),
create_landscape_sharp(),
create_landscape_spots(),
create_landscapes()
Examples
# Default diffuse vegetation boundary
diffuse_default <- create_landscape_diffuse()
# Sharp transition (lower steepness)
diffuse_sharp <- create_landscape_diffuse(
boundary_position = 0.2,
steepness = 0.1
)
# Gradual transition (higher steepness)
diffuse_gradual <- create_landscape_diffuse(
boundary_position = 0.3,
steepness = 0.9
)
# With rotation
diffuse_rotated <- create_landscape_diffuse(
boundary_position = 0.3,
steepness = 0.7,
rotation = 45
)