landscapemetrics (version 1.4.4)

get_circumscribingcircle: get_circumscribingcircle

Description

Diameter of the circumscribing circle around patches

Usage

get_circumscribingcircle(landscape, directions, level)

# S3 method for RasterLayer get_circumscribingcircle(landscape, directions = 8, level = "patch")

# S3 method for RasterStack get_circumscribingcircle(landscape, directions = 8, level = "patch")

# S3 method for RasterBrick get_circumscribingcircle(landscape, directions = 8, level = "patch")

# S3 method for stars get_circumscribingcircle(landscape, directions = 8, level = "patch")

# S3 method for list get_circumscribingcircle(landscape, directions = 8, level = "patch")

Arguments

landscape

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

directions

The number of directions in which patches should be connected: 4 (rook's case) or 8 (queen's case).

level

Either 'patch' or 'class' for the corresponding level.

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.

References

Based on C++ code from Project Nayuki (https://www.nayuki.io/page/smallest-enclosing-circle).

Examples

Run this code
# NOT RUN {
# get circle around each patch
get_circumscribingcircle(landscape)

# get circle around whole class
get_circumscribingcircle(landscape, level = "class")

# }

Run the code above in your browser using DataCamp Workspace