makeLine: Create a linear patch (beta version).

Description Usage Arguments Details Value Examples

Description

Create a linear patch, setting direction and convolution. The higher the convolution degree, the weaker the linear shape (and direction).

Usage

1
2
makeLine(context, size, direction = NULL, convol = 0.5, spt = NULL,
  bgr = 0, edge = FALSE, rast = FALSE, val = 1)

Arguments

context

Raster object or matrix, an empty landscape raster or a mask indicating where the patch cannot be generated (see bgr below).

size

integer. Size of the patch to be generated, as number of raster cells.

direction

numeric. The direction towards which the patch will point and grow, expressed in degrees between 0 and 360.

convol

numeric. Level of convolution to be assigned to the patch (default is convol=0.5). A value between 0 and 1, where 0 is no convolution at all (basically a straight line) and 1 is maximum convolution (i.e. tends to form a circular patch).

spt

integer or matrix. The seed point location around which the patch is generated (a random point is given by default). It can be an integer, as index of the cell in the raster, or a two columns matrix indicating x and y coordinates (an integer vector of length 2 is accepted too).

bgr

integer. A single value of background cells, where a patch can be generated (default is zero). Cells/classes which cannot be changed must have a different value.

edge

logical. Should the vector of edge cells of the patch be returned?

rast

logical. If TRUE returns a Raster object, otherwise a vector of cell numbers where the patch occurs

val

integer. The value to be assigned to patch cells, when rast=TRUE

Details

For any values of convol > 0.8, no big differences are observed noted. Also direction is progressively lost as convolution increases.

Value

A vector of raster cell numbers, or a RasterLayer object if rast=TRUE. If edge=TRUE a list of two vectors is returned: one for the inner raster cells and the second for cells at the edge of the patch.

Examples

1
2
3
4
library(raster)
r <- matrix(0,33,33)
r <- raster(r, xmn=0, xmx=10, ymn=0, ymx=10)
plot(makeLine(r, size=50, spt = 545, direction=45, convol=0.05, rast=TRUE))

landscapeR documentation built on May 1, 2019, 8:28 p.m.