The dask backends (dask+numpy and dask+cupy) compute the map_overlap pad depth as max_distance / cellsize. The cellsize is the coordinate spacing in degrees, but with distance_metric='GREAT_CIRCLE' the max_distance argument is in metres. Dividing a metre distance (millions) by a degree cellsize (a few) gives an overlap depth of hundreds of thousands of pixels, and dask raises ValueError: The overlapping depth N is larger than your array.
The numpy and cupy backends accept the same call and return correct results, so this is a backend-parity defect: a call that works on numpy/cupy crashes on either dask backend.
To reproduce, build a small lat/lon dask raster and call proximity(raster, distance_metric='GREAT_CIRCLE', max_distance=1.5e6). It raises; the numpy-backed copy of the same raster returns a result.
The fix measures the per-pixel pitch with the active distance metric (great-circle metres between adjacent cells) instead of the raw degree cellsize, so the overlap depth is in pixels regardless of metric. EUCLIDEAN and MANHATTAN are unaffected because their max_distance shares units with the cellsize.
Found via accuracy sweep (categories 4 and 5).
The dask backends (dask+numpy and dask+cupy) compute the
map_overlappad depth asmax_distance / cellsize. The cellsize is the coordinate spacing in degrees, but withdistance_metric='GREAT_CIRCLE'themax_distanceargument is in metres. Dividing a metre distance (millions) by a degree cellsize (a few) gives an overlap depth of hundreds of thousands of pixels, and dask raisesValueError: The overlapping depth N is larger than your array.The numpy and cupy backends accept the same call and return correct results, so this is a backend-parity defect: a call that works on numpy/cupy crashes on either dask backend.
To reproduce, build a small lat/lon dask raster and call
proximity(raster, distance_metric='GREAT_CIRCLE', max_distance=1.5e6). It raises; the numpy-backed copy of the same raster returns a result.The fix measures the per-pixel pitch with the active distance metric (great-circle metres between adjacent cells) instead of the raw degree cellsize, so the overlap depth is in pixels regardless of metric. EUCLIDEAN and MANHATTAN are unaffected because their
max_distanceshares units with the cellsize.Found via accuracy sweep (categories 4 and 5).