I am working on a script in which I am rasterising a vector using Rasterio.
When I try to write the raster to a tif file, my cluster runs out of memory and crashes about 30 seconds after the job starts.
Is there a more memory friendly way in which I can save this as a tif file using Rasterio?
My code is below:
with rasterio.open(
os.path.join(dir, filename), "w",
driver="GTiff",
transform=raster.transform,
dtype=rasterio.float32,
count=1,
crs=raster.crs,
width=raster.width,
height=raster.height) as dst:
dst.write(array, indexes = 1)