I have a binary image with pixel resolution in units of degrees (EPSG:4326):
In this case, all the light-blue pixels are water (value = 1) and purple pixels are not water (value = 0). I would like to compute a distance transform of this image, where the result is each pixel's distance away from the nearest "on" (water) pixel. This is doable with scipy:
However, the returned distances are Euclidean with respect to the row, column coordinates of each pixel. Does anyone know of a package or function that will compute a distance transform using the Haversine formula on the lon, lat coordinates rather than the row, col coordinates?
[I know I can reproject to a length-preserving CRS and multiply by the resolution.]