get_circumscribingcircle: get_circumscribingcircle

Description Usage Arguments Details Examples

Description

Diameter of the circumscribing circle around patches

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
get_circumscribingcircle(landscape, resolution_x, resolution_y)

## S3 method for class 'RasterLayer'
get_circumscribingcircle(landscape,
  resolution_x = NULL, resolution_y = NULL)

## S3 method for class 'RasterStack'
get_circumscribingcircle(landscape,
  resolution_x = NULL, resolution_y = NULL)

## S3 method for class 'RasterBrick'
get_circumscribingcircle(landscape,
  resolution_x = NULL, resolution_y = NULL)

## S3 method for class 'stars'
get_circumscribingcircle(landscape, resolution_x = NULL,
  resolution_y = NULL)

## S3 method for class 'list'
get_circumscribingcircle(landscape, resolution_x = NULL,
  resolution_y = NULL)

## S3 method for class 'matrix'
get_circumscribingcircle(landscape, resolution_x = NULL,
  resolution_y = NULL)

Arguments

landscape

RasterLayer or matrix (with x, y, id columns)

resolution_x

Resolution of the landscape (only needed if matrix as input is used)

resolution_y

Resolution of the landscape (only needed if matrix as input is used)

Details

The diameter of the smallest circumscribing circle around a patch in the landscape is based on the maximum distance between the corners of each cell. This ensures that all cells of the patch are included in the patch. All patches need an unique ID (see get_patches). If one uses this functions with a matrix the resolution of the underlying data must be provided.

Examples

1
2
3
4
5
6
7
8
9
# get patches for class 1 from testdata as raster
class_1 <- get_patches(landscape, class = 1)[[1]]

# calculate the minimum circumscribing circle of each patch in class 1
get_circumscribingcircle(class_1)

# do the same with a 3 column matrix (x, y, id)
class_1_matrix <- raster::rasterToPoints(class_1)
get_circumscribingcircle(class_1_matrix, resolution_x = 1, resolution_y = 1)

r-spatialecology/landscapemetrics documentation built on May 20, 2019, noon