earthkit.data.utils.bbox

Classes

BoundingBox

Represent a geographic bounding box.

Functions

bounding_box(obj[, check])

Module Contents

class earthkit.data.utils.bbox.BoundingBox(*, north, west, south, east, check=True)

Represent a geographic bounding box.

Parameters:
  • north (number) – Northern latitude (degrees)

  • west (number) – Western longitude (degrees)

  • south (number) – Southern latitude (degrees)

  • east (number) – Eastern longitude (degrees)

add_margins(margins)

Generates a new BoundingBox object with adjusted margins.

Parameters:

margins (str or number) – The margin to be added to each side. When it is a str must specify a percentage in terms of the current size like “50%”, while a number must specify degrees.

Returns:

New object with adjusted margins.

Return type:

BoundingBox

as_dict()
as_list()
as_tuple()
classmethod from_geopandas(gdf)
property height

Returns the North-South size (degrees).

Type:

number

is_periodic_west_east
classmethod make_invalid()
north
south
classmethod union(bboxes)

Generates the union of a list of BoundingBox objects.

Parameters:

bboxes (list) – Input BoundingBox objects.

Returns:

Union of input objects.

Return type:

BoundingBox

See also

union_with

union_with(other)

Generates the union of the current object and other.

Parameters:

other (BoundingBox) – The object to make the union with.

Returns:

New object containing the union.

Return type:

BoundingBox

See also

union

west
property width

Returns the East-West size (degrees).

Type:

number

earthkit.data.utils.bbox.bounding_box(obj, check=True)