reserve_sizes: Reserve sizes

View source: R/utils_spatial_misc.R

reserve_sizesR Documentation

Reserve sizes

Description

Calculate the size of individual reserves in a solution.

Usage

reserve_sizes(x, areas, boundary_matrix)

Arguments

x

numeric vector containing the solution values for each planning unit.

areas

numeric vector containing the area of each planning unit.

boundary_matrix

Matrix::sparseMatrix() object with boundary length data for the planning units. Or NA indicating that no boundary data is available (see Details for more information)

Details

For spatial uploads (shapefile) with many planning units, building boundary data can result in a std::bad_alloc error. To avoid this, the user can skip generating a boundary matrix on the new_dataset_from_auto method. For these scenarios, reserve sizes can not be calculated when the boundary_matrix is set to NA.

Value

A numeric vector containing the total area of each reserve.


NCC-CNC/wheretowork documentation built on Feb. 27, 2025, 6:11 p.m.