Geographic Information Systems Asked on November 11, 2020
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.]
I would follow these steps:
rasterio
, geopandas
)geopandas
)geopandas
/shapely
)Since there will be millions of points for high resolution raster, this method will be time-consuming.
Answered by Kadir Şahbaz on November 11, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP