Proximity#
Warning
proximity() with distance_metric='EUCLIDEAN' (the default)
returns distances in the coordinate units of the DataArray.
With default integer indices this equals pixel counts. Use
'GREAT_CIRCLE' for lat/lon data (returns metres).
Caution
With Dask, proximity() expands each chunk by max_distance cells.
If max_distance is infinite (the default), the whole array is loaded
into a single chunk. Set a finite max_distance to keep memory
bounded.
Caution
proximity(), allocation(), and direction() require monotonic
1D x and y coordinates (strictly increasing or strictly
decreasing). A non-monotonic axis raises a ValueError; sort the raster
along that axis first.
Allocation#
|
Calculates, for all pixels in the input raster, the nearest source based on a set of target values and a distance metric. |
Direction#
|
Calculates, for all cells in the array, the downward slope direction Calculates, for all pixels in the input raster, the direction to nearest source based on a set of target values and a distance metric. |
Proximity#
Calculates Euclidean (straight line) distance between (x1, y1) and (x2, y2). |
|
Calculates great-circle (orthodromic/spherical) distance between (x1, y1) and (x2, y2), assuming each point is a longitude, latitude pair. |
|
Calculates Manhattan distance (sum of distance in x and y directions) between (x1, y1) and (x2, y2). |
|
|
Computes the proximity of all pixels in the image to a set of pixels in the source image based on a distance metric. |
Cost Distance#
|
Compute accumulated cost-distance through a friction surface. |
Least-Cost Corridor#
|
Compute a least-cost corridor between two source regions. |
Balanced Allocation#
Partition a cost surface into balanced service territories. |
Surface Distance#
Compute surface distance along terrain to nearest target pixel. |
Surface Allocation#
Compute nearest-target allocation along terrain surface. |
Surface Direction#
Compute compass direction to nearest target along terrain surface. |