Fixes #560: weighted A* pathfinding with friction surface#862
Merged
brendancol merged 3 commits intomasterfrom Feb 23, 2026
Merged
Fixes #560: weighted A* pathfinding with friction surface#862brendancol merged 3 commits intomasterfrom
brendancol merged 3 commits intomasterfrom
Conversation
Replace the O(h*w) open-list scan with a binary min-heap (reused from cost_distance) and add optional friction weighting to a_star_search(). Edge costs now use cellsize-scaled spatial distances instead of pixel- space distances, and when a friction surface is provided the cost model matches cost_distance (geometric_distance * mean_friction_of_endpoints).
Sparse dask A* loads chunks on demand via LRU cache so pathfinding works on datasets that don't fit in RAM. CuPy falls back to the existing numpy kernel with CPU↔GPU transfers.
Add backend support table to docstring and user guide notebook, dask out-of-core example, and CPU-fallback symbol in README matrix.
This was referenced Feb 23, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_a_star_searchwith O(log n) heap operations (reused fromcost_distance)a_star_search()accepts an optionalfrictionDataArray; edge costs becomegeometric_distance × mean_friction_of_endpoints, matching thecost_distance()cost modelcost_distance()Test plan
pytest xrspatial/tests/test_pathfinding.py -v— 10 tests pass (4 existing updated for cellsize scaling + 6 new weighted tests)pytest xrspatial/tests/test_cost_distance.py -v— 19 tests unchanged, all passjupyter nbconvert --execute docs/source/user_guide/pathfinding.ipynb— executes cleanly, cost_distance validation printsMatch: True