I am using GDAL to convert a raster dataset into a
numpy.array and then using
numpy to buffer the data in the raster. For example, I need to know all the regions within 100ft of a school point feature and I need it represented as a raster.
So, I convert my points to a binary raster (school points are 1 and all other pixels are) using
GDALRasterize in Python. Then, I open the raster dataset and use
GDAL.ReadAsArray to create a
numpy.array for the raster. Using
scipy.ndimage.morphology.binary_dilation, I buffer all the non-zero pixels.
The issue is: some of my input datasets can be rather large and so I am running out of memory. The first thing that came to mind was to tile my input data and process individual tiles. I'm not sure how to handle any edge effects if I were to tile. What if a buffer spans the edge of a tile? The next tile wouldn't know to include those buffered cells.
Does anyone have any suggestions for how to handle these kinds of edge effects in numpy/GDAL?