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[, ...])

type resolution

Tuple[float, float]

is_empty()

rtype

bool

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

Optional[CRS]

dimensions

List of dimension names of the GeoBox

dims

List of dimension names of the GeoBox

geographic_extent

4326

resolution

Resolution in Y,X dimensions

shape

Tuple[int, int]

transform

Affine

Attributes:

alignment

Alignment of pixel boundaries in Y,X dimensions

coordinates

dict of coordinate labels

coords

dict of coordinate labels

dimensions

List of dimension names of the GeoBox

dims

List of dimension names of the GeoBox

geographic_extent

4326

resolution

Resolution in Y,X dimensions

Methods:

buffered(ybuff, xbuff)

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

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

type resolution

Tuple[float, float]

xr_coords([with_crs])

Dictionary of Coordinates in xarray format

property alignment: Tuple[float, float]#

Alignment of pixel boundaries in Y,X dimensions

Return type

Tuple[float, float]

buffered(ybuff, xbuff)[source]#

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

Return type

GeoBox

property coordinates: Dict[str, datacube.utils.geometry._base.Coordinate]#

dict of coordinate labels

Return type

Dict[str, Coordinate]

property coords: Dict[str, datacube.utils.geometry._base.Coordinate]#

dict of coordinate labels

Return type

Dict[str, Coordinate]

property dimensions: Tuple[str, str]#

List of dimension names of the GeoBox

Return type

Tuple[str, str]

property dims: Tuple[str, str]#

List of dimension names of the GeoBox

Return type

Tuple[str, str]

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

GeoBox

property geographic_extent: datacube.utils.geometry._base.Geometry#

4326

Return type

Geometry

Type

GeoBox extent in EPSG

property resolution: Tuple[float, float]#

Resolution in Y,X dimensions

Return type

Tuple[float, float]

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.

Returns

  • OrderedDict name (str -> xr.DataArray)

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

Return type

Dict[Hashable, DataArray]