Champlain.BoundingBox

Fields

Name

Type

Access

Description

bottom

float

r/w

bottom coordinate

left

float

r/w

left coordinate

right

float

r/w

right coordinate

top

float

r/w

top coordinate

Methods

class

new ()

compose (other)

copy ()

covers (latitude, longitude)

extend (latitude, longitude)

free ()

get_center ()

is_valid ()

Details

class Champlain.BoundingBox

Defines the area of a ChamplainMapDataSource that contains data.

New in version 0.6.

classmethod new()
Returns:

a Champlain.BoundingBox

Return type:

Champlain.BoundingBox

Creates a newly allocated Champlain.BoundingBox to be freed with Champlain.BoundingBox.free().

New in version 0.6.

compose(other)
Parameters:

other (Champlain.BoundingBox) – a Champlain.BoundingBox

Sets bbox equal to the bounding box containing both self and other.

New in version 0.10.

copy()
Returns:

an allocated copy of self.

Return type:

Champlain.BoundingBox

Makes a copy of the bounding box structure. The result must be freed using Champlain.BoundingBox.free().

New in version 0.6.

covers(latitude, longitude)
Parameters:
  • latitude (float) – the latitude of the point

  • longitude (float) – the longitude of the point

Returns:

True when the bounding box covers given coordinates, False otherwise.

Return type:

bool

Checks whether self covers the given coordinates.

New in version 0.12.4.

extend(latitude, longitude)
Parameters:
  • latitude (float) – the latitude of the point

  • longitude (float) – the longitude of the point

Extend the bounding box so it contains a point with latitude and longitude. Do nothing if the point is already inside the bounding box.

New in version 0.10.

free()

Frees a bounding box structure created with Champlain.BoundingBox.new() or Champlain.BoundingBox.copy().

New in version 0.6.

get_center()
Returns:

latitude:

the latitude of the box center

longitude:

the longitude of the box center

Return type:

(latitude: float, longitude: float)

Gets the center’s latitude and longitude of the box to latitude and longitude.

New in version 0.6.

is_valid()
Returns:

True when the bounding box is valid, False otherwise.

Return type:

bool

Checks whether self represents a valid bounding box on the map.

New in version 0.10.