rastertodataframe.tiling module¶
Utils for reading a GDAL Dataset in small tiles.
-
rastertodataframe.tiling.
tiles
(ras, size=256)[source]¶ Generator return a raster array in tiles.
Parameters: - ras (gdal.Dataset) – Input raster.
- size (int) – Size of window in pixels. One value required which is used for both the x and y size. E.g 256 means a 256x256 window.
Yields: np.ndarray – Raster array in form [band][y][x].
-
rastertodataframe.tiling.
windows
(ras, size=256)[source]¶ Generator for raster window size/offsets.
Parameters: - ras (gdal.Dataset) – Input raster.
- size (int) – Size of window in pixels. One value required which is used for both the x and y size. E.g 256 means a 256x256 window.
Yields: tuple[int] – 4 element tuple containing the x size, y size, x offset and y offset of the window.