datacube.utils.geometry.gbox.GeoboxTiles#

class datacube.utils.geometry.gbox.GeoboxTiles(box, tile_shape)[source]#

Partition a GeoBox into sub geoboxes

Construct from a GeoBox.

Parameters:
__init__(box, tile_shape)[source]#

Methods

__init__(box, tile_shape)

chunk_shape(idx)

Chunk shape for a given chunk index.

range_from_bbox(bbox)

Compute rows and columns overlapping with a given BoundingBox

tiles(polygon)

Return tile indexes overlapping the polygon

Attributes

base

The base GeoBox

shape

Number of tiles along each dimension

property base: GeoBox#

The base GeoBox

chunk_shape(idx)[source]#

Chunk shape for a given chunk index.

Parameters:

idx (Tuple[int, int]) – (row, col) index

Raises:

IndexError when index is outside of [(0,0) -> .shape)

Return type:

Tuple[int, int]

Returns:

tuple (nrow, ncols) shape of a tile (edge tiles might be smaller)

range_from_bbox(bbox)[source]#

Compute rows and columns overlapping with a given BoundingBox

Return type:

Tuple[range, range]

property shape#

Number of tiles along each dimension

tiles(polygon)[source]#

Return tile indexes overlapping the polygon

Return type:

Iterable[Tuple[int, int]]