Commit a676430
authored
Add surface_distance module: 3D terrain distance via multi-source Dijkstra (#918)
* Add surface_distance module: 3D terrain distance via multi-source Dijkstra
Adds surface_distance(), surface_allocation(), and surface_direction()
which compute distance, nearest-target allocation, and compass direction
along a 3D terrain surface (DEM). Unlike proximity (flat 2D Euclidean)
or cost_distance (scalar friction), edge costs account for elevation
relief: sqrt(horizontal_dist² + dz²).
Backends: NumPy (Dijkstra), CuPy (parallel Bellman-Ford relaxation),
Dask+NumPy bounded (map_overlap) and unbounded (iterative boundary
Dijkstra), Dask+CuPy. Geodesic mode (lat/lon → great-circle horizontal
distances) supported for NumPy.
Includes 32 tests, ASV benchmarks, __init__ exports, and .xrs accessor
methods on both DataArray and Dataset.
* Add surface distance functions to README proximity table1 parent c2ef6cc commit a676430
File tree
6 files changed
+2172
-0
lines changed- benchmarks/benchmarks
- xrspatial
- tests
6 files changed
+2172
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
209 | 212 | | |
210 | 213 | | |
211 | 214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
100 | 112 | | |
101 | 113 | | |
102 | 114 | | |
| |||
259 | 271 | | |
260 | 272 | | |
261 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
262 | 286 | | |
263 | 287 | | |
264 | 288 | | |
| |||
0 commit comments