Note: This is still a work in progress and significant bugs may be present. Use with caution
More information on the original implemention of MinPatch for Marxan and QGIS is available here: https://cluz-systematic-conservation-planning.github.io
An R implementation of the MinPatch algorithm for post-processing conservation planning solutions to ensure minimum protected area sizes.
MinPatch is a post-processing tool for conservation planning solutions
that ensures all protected areas meet user-defined minimum size
thresholds. This R package implements the methodology described in Smith
et al. (2010) and is designed to work with solutions from the
prioritizr package, though it can work with any binary conservation
solution.
Conservation planning software like Marxan and prioritizr can produce solutions with many small, fragmented protected areas. While these solutions may be mathematically optimal, small protected areas are often:
- Less ecologically viable
- More expensive to manage
- More vulnerable to edge effects
- Less resilient to disturbances
MinPatch addresses this by post-processing conservation solutions through three stages:
- Remove Small Patches: Eliminate protected areas smaller than a minimum size threshold
- Add New Patches: Add new areas to meet conservation targets using the BestPatch algorithm
- Simulated Whittling: Remove unnecessary planning units while maintaining constraints
# Install from GitHub
pak::pak("SpatialPlanning/minpatch")- Full MinPatch Algorithm: Complete implementation of all three stages
- prioritizr Integration: Seamless workflow with prioritizr solutions
- Locked Constraints Support: Automatically respects locked-in and locked-out constraints from prioritizr
- Flexible Parameters: Control minimum patch sizes, patch radius, and boundary penalties
- Comprehensive Reporting: Detailed statistics and comparisons
- Visualization Support: Plot results with ggplot2 (optional)
MinPatch automatically respects locked-in and locked-out constraints from prioritizr problems:
-
Locked-in constraints (from
add_locked_in_constraints()): Planning units that are locked-in will never be removed, regardless of patch size or during the whittling stage. These units are treated as “conserved” areas that must be retained in the final solution. -
Locked-out constraints (from
add_locked_out_constraints()): Planning units that are locked-out will never be selected, even when adding new patches to meet conservation targets. These units are completely excluded from consideration.
If locked-in units form patches smaller than min_patch_size, a warning
will be issued, but these units will still be preserved in the solution.
Identifies connected components (patches) in the solution and removes those smaller than the minimum size threshold. Locked-in planning units are never removed, even if they form small patches.
Uses the BestPatch scoring system to add new patches:
- Calculate current conservation levels for each feature
- Identify features with unmet targets
- Score potential patches based on their contribution to targets relative to cost
- Add the highest-scoring patch and repeat
The BestPatch score is calculated as:
Score = Σ(feature_contribution / target_gap) / patch_cost
Removes unnecessary planning units through an iterative process:
- Identify edge units (on the boundary of selected areas)
- Calculate whittling scores based on feature importance
- Remove units that don’t violate constraints:
- Must not cause targets to be unmet
- Must not make patches too small
- Must not increase total cost (if boundary penalty > 0)
- Must not split patches into non-viable pieces
If you use this package, please cite both the original paper and this implementation:
Smith, R.J., Di Minin, E., Linke, S., Segan, D.B., Possingham, H.P. (2010).
An approach for ensuring minimum protected area size in systematic conservation planning.
Biological Conservation, 143(10), 2525-2531.
Everett J.D., Richardson A.J., Smith R.J. (2025). _minpatch: Post-Processing for Conservation Planning Solutions to Ensure Minimum Patch
Sizes_. R package version 0.1.0, <https://github.com/SpatialPlanning/minpatch>.
GPL (>= 3)
Smith, R.J., Di Minin, E., Linke, S., Segan, D.B., Possingham, H.P. (2010). An approach for ensuring minimum protected area size in systematic conservation planning. Biological Conservation, 143(10), 2525-2531.
- Check the package vignette:
vignette("minpatch") - View function documentation:
?run_minpatch - Report bugs: GitHub Issues