Add landscape fragmentation metrics and habitat connectivity

Open
#1,141 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
python
Domain
data

Research direction

Begin by narrowing the proposal into a specific metric or connectivity feature, then inspect the existing regions() and least_cost_corridor() entry points. Done should be defined by an agreed subset, documented categorical-raster inputs and outputs, and tests for the selected metrics; no test files are named here.

Written by the indexing model from the issue text.

Description

after-1.0.0-release enhancement

Ecology and conservation workflows need landscape pattern metrics and connectivity analysis. Neither is currently available in xarray-spatial.

Scope

Landscape metrics (FRAGSTATS-style)

Patch-level and landscape-level metrics computed on categorical rasters:

  • Patch area, perimeter, shape index
  • Edge density
  • Core area
  • Fractal dimension
  • Contagion

These should work both per-class and landscape-wide.

Fragmentation assessment

  • Effective mesh size
  • Patch cohesion

Resistance-surface connectivity

  • Least-cost corridor networks between multiple source patches. This extends the existing pairwise least_cost_corridor() to handle N source patches simultaneously and produce a combined corridor surface.
  • Circuit-theory connectivity (Circuitscape-style current flow). This requires a sparse linear solve and is computationally expensive, but it's in very high demand for conservation planning.

Design notes

Landscape metrics operate on categorical rasters and pair naturally with existing regions() for patch identification. The regions output can feed directly into metric computation.

Circuit-theory connectivity is the most complex piece here. A basic implementation could use scipy sparse solvers on CPU and cuSparse on GPU. Even a simplified version (e.g., pairwise resistance distance without full current maps) would be useful.

Dominant language
Python
Stars
972
Forks
92
Avg merge
2d 12h
Merged PRs (30d)
7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from xarray-contrib/xarray-spatial

All issues in xarray-contrib/xarray-spatial

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.