datacube.utils.geometry.GeoBox#

class datacube.utils.geometry.GeoBox(width, height, affine, crs)[source]#

Defines the location and resolution of a rectangular grid of data, including it’s CRS.

Parameters:
  • crs (Union[str, CRS, CRS, Dict[str, Any], None]) – Coordinate Reference System

  • affine (Affine) – Affine transformation defining the location of the geobox

__init__(width, height, affine, crs)[source]#

Methods

__init__(width, height, affine, crs)

buffered(ybuff, xbuff)

Produce a tile buffered by ybuff, xbuff (in CRS units)

from_geopolygon(geopolygon, resolution[, ...])

is_empty()

xr_coords([with_crs])

Dictionary of Coordinates in xarray format

Attributes

alignment

Alignment of pixel boundaries in Y,X dimensions

coordinates

dict of coordinate labels

coords

dict of coordinate labels

crs

dimensions

List of dimension names of the GeoBox

dims

List of dimension names of the GeoBox

geographic_extent

GeoBox extent in EPSG:4326

resolution

Resolution in Y,X dimensions

shape

transform

property alignment: Tuple[float, float]#

Alignment of pixel boundaries in Y,X dimensions

buffered(ybuff, xbuff)[source]#

Produce a tile buffered by ybuff, xbuff (in CRS units)

Return type:

GeoBox

property coordinates: Dict[str, Coordinate]#

dict of coordinate labels

property coords: Dict[str, Coordinate]#

dict of coordinate labels

property dimensions: Tuple[str, str]#

List of dimension names of the GeoBox

property dims: Tuple[str, str]#

List of dimension names of the GeoBox

classmethod from_geopolygon(geopolygon, resolution, crs=None, align=None)[source]#
Parameters:
Return type:

GeoBox

property geographic_extent: Geometry#

GeoBox extent in EPSG:4326

property resolution: Tuple[float, float]#

Resolution in Y,X dimensions

xr_coords(with_crs=False)[source]#

Dictionary of Coordinates in xarray format

Parameters:

with_crs (Union[bool, str]) – If True include netcdf/cf style CRS Coordinate with default name ‘spatial_ref’, if with_crs is a string then treat the string as a name of the coordinate.

Return type:

Dict[Hashable, DataArray]

Returns#

OrderedDict name:str -> xr.DataArray

where names are either y,x for projected or latitude, longitude for geographic.