datacube.utils.geometry.BoundingBox#

class datacube.utils.geometry.BoundingBox(left, bottom, right, top)[source]#

Bounding box, defining extent in cartesian coordinates.

Create new instance of BoundingBox(left, bottom, right, top)

__init__()#

Methods

__init__()

buffered(ybuff, xbuff)

Return a new BoundingBox, buffered in the x and y dimensions.

count(value, /)

Return number of occurrences of value.

from_points(p1, p2)

BoundingBox from 2 points :type p1: Tuple[float, float] :param p1: (x, y) :type p2: Tuple[float, float] :param p2: (x, y)

from_xy(x, y)

BoundingBox from x and y ranges

index(value[, start, stop])

Return first index of value.

transform(transform)

Transform bounding box through a linear transform

Attributes

bottom

Alias for field number 1

height

int

left

Alias for field number 0

points

Extract four corners of the bounding box

range_x

Tuple[float, float]

range_y

Tuple[float, float]

right

Alias for field number 2

span_x

float

span_y

float

top

Alias for field number 3

width

int

Attributes:

bottom

Alias for field number 1

left

Alias for field number 0

points

Extract four corners of the bounding box

right

Alias for field number 2

top

Alias for field number 3

Methods:

buffered(ybuff, xbuff)

Return a new BoundingBox, buffered in the x and y dimensions.

count(value, /)

Return number of occurrences of value.

from_points(p1, p2)

BoundingBox from 2 points :type p1: Tuple[float, float] :param p1: (x, y) :type p2: Tuple[float, float] :param p2: (x, y)

from_xy(x, y)

BoundingBox from x and y ranges

index(value[, start, stop])

Return first index of value.

transform(transform)

Transform bounding box through a linear transform

bottom#

Alias for field number 1

buffered(ybuff, xbuff)[source]#

Return a new BoundingBox, buffered in the x and y dimensions.

Parameters
  • ybuff (float) – Y dimension buffering amount

  • xbuff (float) – X dimension buffering amount

Return type

BoundingBox

Returns

new BoundingBox

count(value, /)#

Return number of occurrences of value.

static from_points(p1, p2)[source]#

BoundingBox from 2 points :type p1: Tuple[float, float] :param p1: (x, y) :type p2: Tuple[float, float] :param p2: (x, y)

Return type

BoundingBox

static from_xy(x, y)[source]#

BoundingBox from x and y ranges

Parameters
Return type

BoundingBox

index(value, start=0, stop=9223372036854775807, /)#

Return first index of value.

Raises ValueError if the value is not present.

left#

Alias for field number 0

property points: List[Tuple[float, float]]#

Extract four corners of the bounding box

Return type

List[Tuple[float, float]]

right#

Alias for field number 2

top#

Alias for field number 3

transform(transform)[source]#

Transform bounding box through a linear transform

Apply linear transform on 4 points of the bounding box and compute bounding box of these four points.

Return type

BoundingBox