raster_tools.Raster.get_chunk_bounding_boxes#

Raster.get_chunk_bounding_boxes(include_band=False)[source]#

Return GeoDataFrame with the chunk bounding boxes.

This method generates a GeoDataFrame of bounding boxes for the underlying data chunks. By default it does this for a single band since the bounding boxes are the same across bands. The result also contains columns for the chunk position in the data.

By default, the result has two position columns: ‘chunk_row’ and ‘chunk_col’. Setting include_band adds ‘chunk_band’.

Parameters

include_band (bool, optional) – Duplicates the result across bands and adds a third position column named ‘chunk_band’. Default is False.

Examples

>>> dem = Raster("data/dem.tif")
>>> dem.get_chunk_bounding_boxes()
    chunk_row  chunk_col                                           geometry
0           0          0  POLYGON ((-32863.383 53183.938, -32863.383 681...
1           0          1  POLYGON ((-17863.383 53183.938, -17863.383 681...
2           0          2  POLYGON ((-2863.383 53183.938, -2863.383 68183...
3           0          3  POLYGON ((12136.617 53183.938, 12136.617 68183...
4           0          4  POLYGON ((27136.617 53183.938, 27136.617 68183...
...
>>> dem.get_chunk_bounding_boxes(True)
    chunk_band  chunk_row  chunk_col                                           geometry
0            0          0          0  POLYGON ((-32863.383 53183.938, -32863.383 681...
1            0          0          1  POLYGON ((-17863.383 53183.938, -17863.383 681...
2            0          0          2  POLYGON ((-2863.383 53183.938, -2863.383 68183...
3            0          0          3  POLYGON ((12136.617 53183.938, 12136.617 68183...
4            0          0          4  POLYGON ((27136.617 53183.938, 27136.617 68183...
...