Skip to content

Add least-cost corridor analysis (#965)#968

Merged
brendancol merged 3 commits into
masterfrom
issue-965
Mar 4, 2026
Merged

Add least-cost corridor analysis (#965)#968
brendancol merged 3 commits into
masterfrom
issue-965

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Summary

  • Adds least_cost_corridor() -- sums two cost-distance surfaces, normalizes by the minimum, and optionally masks by a threshold
  • Wraps existing cost_distance with no new kernels, so all four backends (NumPy, CuPy, Dask+NumPy, Dask+CuPy) work out of the box
  • Supports absolute and relative thresholding, pre-computed cost-distance inputs, and multi-source pairwise mode

Test plan

  • pytest xrspatial/tests/test_corridor.py -- 20 tests: symmetry, optimal-path minimum, absolute/relative thresholds, precomputed surfaces, pairwise mode, barriers, unreachable sources, single-cell input, input validation
  • Parametrized across numpy and dask+numpy backends
  • Run notebook 20_Corridor_Analysis.ipynb end-to-end

Closes #965

Computes corridors of low cumulative cost between source locations
by summing two cost-distance surfaces and normalizing. Supports
absolute and relative thresholding, pre-computed cost-distance
inputs, and multi-source pairwise corridors.
Covers symmetry, optimal path minimum, absolute and relative
thresholding, precomputed surfaces, multi-source pairwise,
barriers, unreachable sources, single-cell input, and input
validation. All parametrized across numpy and dask+numpy backends.
Adds API reference entry under Proximity, a user guide notebook
(20_Corridor_Analysis) covering all major features, and a row
in the README feature matrix.
@github-actions github-actions Bot added the performance PR touches performance-sensitive code label Mar 4, 2026
@brendancol brendancol merged commit a61e006 into master Mar 4, 2026
11 checks passed
@brendancol brendancol deleted the issue-965 branch May 4, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR touches performance-sensitive code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add least-cost corridor analysis to proximity module

1 participant