We were having numerous issues with the aggregation approach for chipped predictions using rastervision including improper handling of ROIs and frequent OOM errors. I replaced this with a version using rasterio directly. This uses windowed read/writes so all bookkeeping is done on disk. This does require substantial temporary disk storage, but is generally more robust.
I still need to do a bit of cleanup and documentation but this is now functional.
On future improvement that I don't think needs to be addressed on this PR is to allow tiled predictions that are geospatially referenced, rather than requiring that they are referenced by pixel coordinates in the original raster. This should be fairly straightforward, but would require us to support resampling if the predictions are provided in a different CRS than the original raster.
We were having numerous issues with the aggregation approach for chipped predictions using
rastervision
including improper handling of ROIs and frequent OOM errors. I replaced this with a version usingrasterio
directly. This uses windowed read/writes so all bookkeeping is done on disk. This does require substantial temporary disk storage, but is generally more robust.I still need to do a bit of cleanup and documentation but this is now functional.
On future improvement that I don't think needs to be addressed on this PR is to allow tiled predictions that are geospatially referenced, rather than requiring that they are referenced by pixel coordinates in the original raster. This should be fairly straightforward, but would require us to support resampling if the predictions are provided in a different CRS than the original raster.