Skip to contents

Fractal terrain generation with the diamond-square algorithm

Usage

flsgen_terrain(
  width,
  height,
  roughness = 0.5,
  x = 0,
  y = 0,
  resolution = 1e-04,
  epsg = "EPSG:4326"
)

Arguments

width

Width (in pixels) of output raster

height

Height (in pixels) of output raster

roughness

Roughness factor (or H), between 0 and 1

x

X position (geographical coordinates) of the top-left output raster pixel

y

Y position (geographical coordinates) of the top-left output raster pixel

resolution

Spatial resolution (geographical units) of the output raster (i.e. pixel dimension)

epsg

EPSG identifier of the output projection

Value

A terra::rast object

Examples

  if (FALSE) {
    terrain <- flsgen_terrain(200, 200)
  }