
Add constraint to enforce a minimum effective mesh size (MESH) value
Source:R/add_min_mesh_constraint.R
add_min_mesh_constraint.Rd
Add constraint to a restoration problem (restopt_problem()
) object
to specify the minimum effective mesh size of a solution.
Arguments
- problem
restopt_problem()
Restoration problem object.- min_mesh
numeric
Minimum MESH value.- precision
integer
Precision for calculations. Defaults to 4.- unit
unit
object or acharacter
that can be coerced to an area unit (seeunit
package), or "cells" for cell width of aggregated habitat raster. Corresponds to the unit of the minimum mesh value If the input habitat raster does not use a projected coordinate system, only "cells" is available. Defaults to "ha".
Value
An updated restoration problem (restopt_problem()
) object.
Details
The effective mesh size (MESH) is a measure of landscape fragmentation based on the probability that two randomly chosen points are located in the same patch (Jaeger, 2000). Maximizing it in the context of restoration favours fewer and larger patches.
References
Jaeger, J. A. G. (2000). Landscape division, splitting index, and effective mesh size: New measures of landscape fragmentation. Landscape Ecology, 15(2), 115‑130. https://doi.org/10.1023/A:1008129329289
See also
Examples
if (FALSE) { # \dontrun{
# load data
habitat_data <- rast(
system.file("extdata", "habitat_hi_res.tif", package = "restoptr")
)
# create problem
p <- restopt_problem(
existing_habitat = habitat_data,
aggregation_factor = 16,
habitat_threshold = 0.7
) %>%
add_restorable_constraint(
min_restore = 200,
max_restore = 300,
) %>%
add_min_mesh_constraint(min_mesh = 2500, unit = "ha")
# plot preprocessed data
plot(rast(list(p$data$existing_habitat, p$data$restorable_habitat)), nc = 2)
# print problem
print(p)
# Solve problem
s <- solve(p)
# plot solution
plot(s)
} # }