View source: R/parks_calc_attributes_helpers.R
raster_edge_length | R Documentation |
Helper function within parks_calc_attributes()
.
The total edge length of (classified) raster patches contained within
the polygons
will be calculated. Additionally, the argument raster_edge_buffer
provides a way include patches
in close proximity to the polygons
. The total edge lengths are summed together and appended to the polygons
data as additional columns (or one column, if there is only one raster class).
Note that this operation may take a while to complete, as it involves the conversion of rasters to polygons (and vice versa).
raster_edge_length(
polygons,
raster,
raster_min_patch_size = units::set_units(0, "m^2"),
raster_edge_buffer = units::set_units(0, "m^2"),
relative = TRUE
)
polygons |
|
raster |
|
raster_min_patch_size |
Minimum patch size to be included in results.
Provided either as a units object (see |
raster_edge_buffer |
numeric. Specify buffer distance to add to polygonised raster; the total edge length of |
relative |
logical. Whether or not to calculate relative amounts
(i.e. ratio of edge-to-perimeter length). Defaults to |
polygons
with added column(s) < class value >_length
, and < class value >_length_perim_ratio
if relative
is set to TRUE
.
Note that the value 0
will be summarised; convert pixels to NA
if you wish to exclude them.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.