Ecological corridor planning for habitat connectivity
TerraLink is a QGIS plugin for building and comparing habitat-corridor scenarios under spatial, budget, and barrier constraints. It supports raster and vector inputs, four optimization modes, optional impassable areas, and a PRE/POST landscape-metrics report for scenario comparison.
- What TerraLink Does
- Installation and Access
- How The Current Architecture Works
- Quick Start
- Optimization Modes
- Interpretation Guardrails
- Input Modes and Parameters
- Outputs
- Landscape Metrics Report
- Tips and Best Practices
- Troubleshooting
- Credits and Contact
TerraLink analyzes an input of wildlife habitat patches and identifies corridors that best match a chosen connectivity objective. It helps users identify which parts of a landscape, when restored into habitat, are likely to have the greatest effect on connectivity.
In practice, you specify:
- the habitat layer
- the optimization mode
- minimum patch size
- corridor width
- search radius
- corridor budget
- optional impassable areas
TerraLink then runs the corridor analysis, adds output layers to QGIS, and writes tables of run summaries and connectivity metrics of the new landscape.
It is designed for scenario testing rather than one-shot “optimal truth.” The intended workflow is to run several plausible settings and compare the mapped outputs and PRE/POST metrics.
- QGIS 3.22 or newer
- Standard QGIS Python environment with NumPy, GDAL/OGR, and PyQt
- Download the TerraLink plugin ZIP.
- In QGIS, open
Plugins->Manage and Install Plugins. - Choose
Install from ZIP. - Select the ZIP and install it.
After installation, TerraLink is available from:
- the toolbar as
Run TerraLink - the QGIS plugin menu
- the Processing Toolbox under
SORUS->TerraLink->Open TerraLink
TerraLink has two input modes
If you start with polygon habitat patches, TerraLink analyzes those polygons directly.
If you start with a raster, TerraLink:
- reads the habitat values you selected
- builds habitat and optional raster impassable masks
- polygonizes the habitat mask into a temporary vector layer
- sends that temporary vector layer, plus any routing masks, into the same corridor-generation backend used by vector runs
Raster impassables remain as a width-aware routing mask during that delegated vector run. The practical result is that raster and vector runs share the same corridor-selection backend, while raster setup still uses raster values, pixel neighborhood, and raster unit conversion.
- Load a habitat layer into QGIS.
- Open TerraLink from the toolbar, menu, or Processing Toolbox.
- Choose
RasterorVectorinput mode. - Select the input layer.
- Set the optimization mode.
- Set minimum patch size, corridor width, budget, and search radius.
- Add impassable values or layers if needed.
- Choose an output folder or keep temporary output enabled.
- Click
Run. - Review the map layers, run summary and landscape-metrics report.
TerraLink currently exposes four optimization modes in both raster and vector input modes. The right mode depends on whether you want one dominant backbone, broad gains in connected habitat area, pair-value-driven component joining, or more route options and redundancy.
- Goal: prioritize one dominant connected network.
- Best for: backbone-style consolidation where you want one main habitat system rather than several medium-sized subnetworks. This may be most useful for wildlife that needs large uninterrupted habitat patches, such as wildcats.
- Behavior: TerraLink concentrates the budget spend on the network that most improves the single largest connected system, and after selection it enforces a single largest connected output if disconnected corridor fragments remain.
- Choose this when:
- you want to build one flagship core network
- you are planning around one focal population or one priority movement system
- you care more about the largest connected block than about spreading gains across the landscape
- Example: you have a fragmented reserve complex and want to use limited restoration budget to create the biggest possible continuous network around the main protected area.
- Goal: prioritize high-value joins between the patches and subnetworks a corridor connects.
- Best for: landscapes where the value of a corridor should depend on the current patches and networks it joins, not just whether it creates newly counted connected area.
- Behavior: scores a candidate by the combined value of the patches and networks it joins per unit cost. Patches already inside connected subnetworks are still eligible, so this mode can connect a patch more than once when the additional join is valuable enough.
- Choose this when:
- you want patch-to-patch joins to stay valuable during the run, even if one or both patches get connected by other corridors elsewhere
- you want a pair-driven strategy without the explicit single-backbone bias of LSN
- Example: you have many scattered patches, but want TerraLink to keep valuing strategic joins involving patches or networks that have already been connected elsewhere. MCN A can therefore favor corridors into already valuable networks when the join value is high relative to corridor cost.
- Goal: maximize total habitat area that ends up in connected networks.
- Best for: broad structural connectivity gains where you want more habitat recruited into connected networks.
- Behavior: scores solutions by connected network area first, then uses lower budget, shorter length, and fewer corridors as tie-breakers. It does not try to force everything into one dominant backbone.
- Choose this when:
- you want the budget to maximize connected habitat area across the landscape
- creating several useful networks is acceptable
- you care more about total connected habitat than about forcing one flagship network
- Example: you have many scattered patches and want TerraLink to spend a limited corridor budget on the set of links that places the most habitat into connected networks. MCN B mainly rewards corridors that bring new habitat into connected networks; it usually will not add extra alternate routes inside a network unless they are part of a chain or later budget-fill behavior.
- Goal: reduce difficulty traversing the landscape, create alternate routes, and reduce dependence on chokepoints.
- Best for: improving route quality, shortening movement paths, and adding redundancy rather than only increasing connected area.
- Behavior: can retain more than one useful connection pattern when that meaningfully improves landscape fluidity. Unlike MCN and LSN, LF can keep multiple corridors for the same patch pair when those corridors represent distinct useful routes.
- Choose this when:
- the landscape is already partly connected but movement is brittle or bottlenecked
- you care about alternate paths, loop creation, or reduced reliance on a single bridge
- you want to improve movement quality through the network, not just attach more area
- Example: two large habitat blocks are already linked by one narrow route, and you want to test whether adding alternate pathways around that chokepoint would make the overall network more robust.
TerraLink outputs are optimization results under the assumptions you supplied. They should be interpreted as decision support, not as a universal statement of how organisms will move in the landscape.
- A selected corridor is the best use of the specified budget under the chosen mode, patch definition, search radius, corridor width, and barrier setup.
- A corridor not being selected does not mean it has no ecological value. It may simply have ranked lower under the current objective or fallen outside the candidate search space.
- Results are sensitive to scale. Search radius, raster resolution, minimum patch size, and barrier detail can all change which corridors are available or worthwhile.
- Results are also sensitive to ecological framing. Different species, movement assumptions, and habitat definitions can legitimately produce different "best" corridors on the same map.
- TerraLink is not a full current-flow solver like Circuitscape or Omniscape. Even Landscape Fluidity uses graph-based resistance and redundancy logic on selected corridor networks, not continuous current flow across every cell.
- Stronger confidence comes from agreement across runs. Corridors that keep appearing across plausible parameter sets are more defensible than corridors that only appear under one narrow setup.
Recommended interpretation workflow:
- Run more than one plausible scenario rather than relying on a single parameter set.
- Compare map outputs and summary metrics together. Sometimes a certain optimization mode will score best on all metrics and on other landscapes each optimization mode will score best on a different metric.
- If the goal is species-specific planning, build separate runs or presets for each focal species instead of treating one generic run as universally applicable.
Raster mode is for land-cover or habitat rasters where one or more raster values define habitat.
Layer type:RasterInput layer: raster layer to analyzeRaster units:Pixels,Metric, orImperialPixel neighborhood: 4- or 8-neighbor patch definitionPatch values: one or more habitat valuesMin patch sizeBudgetCorridor widthSearch radiusAssign corridor cells- optional
Impassable values - optional
Allow corridors to pass through bottlenecks
Pixelskeeps patch size, budget, corridor width, and search radius in raster-cell units.Metricuses hectares for patch size and budget, meters for corridor width, and kilometers for search radius.Imperialuses acres for patch size and budget, feet for corridor width, and miles for search radius.- If the raster CRS is not suitable for measured units, use
Pixelsor reproject the raster first.
Raster impassables are configured as value lists or ranges. Habitat cells are treated separately from impassables so corridors can meet patch edges. Bottleneck handling controls whether corridors may squeeze through narrow gaps that would otherwise be blocked by the width constraint.
Vector mode is for polygon habitat patches where each feature represents one patch.
Layer type:VectorInput layer: polygon patch layerVector units:MetricorImperialMin patch sizeBudgetCorridor widthSearch radius- optional impassable polygon layers
- optional navigator
Grid cell sizefor routing around impassables
Vector Metric units use hectares for patch size and budget, meters for corridor width, and kilometers for search radius. Vector Imperial units use acres, feet, and miles.
- The input must be a valid polygon layer.
- The run must contain at least two valid patches after filtering.
- Very large patch counts may be rejected for performance reasons.
TerraLink always adds outputs to QGIS. When you save to disk, it also writes output files. When temporary output is enabled, mapped layers are added as temporary layers and reports are written to temporary files.
The current saved corridor backend is vector-based.
- Saved runs write a GeoPackage of corridor outputs.
- Vector-style corridor layers are added to QGIS for both raster and vector input modes.
- Saved runs also write a
Contiguous Areaslayer representing dissolved patch-plus-corridor networks.
In other words, raster input does not currently produce a native corridor raster output. Raster input is converted to polygon patches and the resulting outputs follow the vector backend.
Vector corridor outputs include corridor-level attributes such as:
- patch identifiers
- corridor area
- corridor length
- connected area
- efficiency
- flags describing cases such as multipatch or isthmus behavior
Saved and temporary runs also produce a contiguous-network output representing connected patch-plus-corridor systems.
Both raster and vector runs produce:
- a landscape-metrics text report
- a landscape-metrics table layer in QGIS
Vector-backend runs also produce:
- a vector summary CSV
- a QGIS table layer based on that CSV
Because raster input delegates into the vector backend, raster runs also follow this vector-style summary pattern.
The raster dialog still includes Assign corridor cells with these choices:
Sum area of patches directly connectedSum area of total networkEfficiency (corridor area / connected patches)
These settings are still part of the raster parameter surface, but they should not be interpreted as evidence of a separate native raster corridor-output pipeline.
Each run writes a PRE/POST landscape-metrics report for comparison across scenarios.
Depending on the run and available methods, the report can include:
- total connected habitat area
- largest connected network (
LCC) - Probability of Connectivity (
PC) - mean effective resistance
- Total connected habitat area is useful for checking how much habitat has been brought into multi-patch networks. Use it when the main question is whether a scenario connects more habitat overall, even if that habitat is split across several networks. Higher values usually indicate broader structural connectivity gains.
- Largest connected network (
LCC) is useful for checking whether a scenario builds one large connected habitat system. Use it when planning around one priority movement system, one focal population, or species that benefit from a large continuous network. Higher values indicate a larger dominant network. - Probability of Connectivity (
PC) is useful for comparing functional connectivity among patches while accounting for patch area and distance-decayed movement probability. Use it when large nearby patches should count more than small or distant patches. Higher values indicate stronger expected connectivity across the landscape. - Mean effective resistance is useful for checking how difficult movement remains through the selected network. Use it when the concern is travel difficulty, detours, bottlenecks, or whether corridors create easier routes between habitat patches. Lower values are better.
- Compare scenarios on the same landscape rather than treating any one metric as an absolute truth.
- Interpret structural and functional metrics separately.
- Be careful about scale, raster resolution, and patch definition.
- Use mapped outputs and the metrics report together.
- Start with a smaller study area or conservative budget to confirm settings before scaling up.
- Keep search radius realistic; very large values increase runtime. In general the radius does not have to larger than your longest potential corridor
- For raster inputs, start with simple habitat values first.
- For vector inputs, fix invalid geometries before running if you suspect topology issues.
- Use temporary output while iterating quickly, then save to disk once you have a scenario worth keeping.
- Compare multiple runs rather than over-interpreting a single result.
- Increase budget.
- Increase search radius.
- Reduce corridor width.
- Make sure at least two habitat patches remain after filtering.
- Raster: confirm the impassable values actually occur in the raster.
- Vector: confirm selected impassable layers are valid polygon layers.
- Vector: reduce navigator grid cell size if thin barriers are being missed.
- Reproject the raster to a suitable projected CRS, or switch raster units to
Pixels.
- Reduce study area.
- Increase minimum patch size.
- Use a smaller search radius.
- Simplify barriers or disable them temporarily for diagnosis.
- TerraLink still attempts to save an error report if the metrics step fails.
- Check the generated report path in the
Logtab.
TerraLink was created by Ben Bishop at SORUS as a practical QGIS tool for habitat-connectivity planning.
Bug reports and feature requests are welcome through the GitHub issue tracker listed in the plugin metadata or by email at benjamin.bishop@sorusconsultingllc.com.
Special thanks to Benjamin Yannis and Christopher Pavia for feedback on early versions of TerraLink.