Bbox#

class core.bbox.Bbox(ll, ur)[source]#

Bases: object

Class to represent a boundary box

Methods:

__init__(ll, ur)

Constructor of Bbox

__str__()

String representation of Bbox

copy()

Copy the current object

getSrid()

getLowerLeft()

Return the lower-left coordinates of Bbox

getUpperRight()

Return the upper-right coordinates of Bbox

getXmin()

Return the min X coordinate

getYmin()

Return the min Y coordinate

getXmax()

Return the max X coordinate

getYmax()

Return the max Y coordinate

getDx()

Return the difference of X coordinates

getDy()

Return the difference of Y coordinates

getDimensions()

Return Dx and Dy

setXmin(xmin)

Set Xmin coordinate

setYmin(ymin)

Set Ymin coordinate

setXmax(xmax)

Set Xmax coordinate

setYmax(ymax)

Set Ymax coordinate

plot([sym, append])

TODO

contains(point)

Check if a point is in the bbox

translate(dx, dy)

Translation (2D) of shape

rotate(theta)

Rotation (2D) of shape

scale(h)

Homothetic transformation (2D) of shape

geom()

Convert to Geometrics (Polygon)

toECEFCoords([base])

Coordinate transformation to core.Coords.ECEFCoords

toGeoCoords([base])

Coordinate transformation to core.Coords.GeoCoords

toENUCoords([base])

Coordinate transformation to core.Coords.ENUCoords

addMargin([margin])

Adding margin (relative float) to bounding box

asTuple()

Transform the Bbox object in a tuple of coordinates

__init__(ll, ur)[source]#

Constructor of Bbox

Parameters:
  • ll (Union[ENUCoords, ECEFCoords, GeoCoords]) – lower left point

  • ur (Union[ENUCoords, ECEFCoords, GeoCoords]) – upper right point

__str__()[source]#

String representation of Bbox

Return type:

str

Returns:

String representation of bbox

copy()[source]#

Copy the current object

Return type:

Bbox

Returns:

Copy of bbox

getSrid()[source]#
getLowerLeft()[source]#

Return the lower-left coordinates of Bbox

Return type:

Union[ENUCoords, ECEFCoords, GeoCoords]

Returns:

Lower-left coordinates

getUpperRight()[source]#

Return the upper-right coordinates of Bbox

Return type:

Union[ENUCoords, ECEFCoords, GeoCoords]

Returns:

Upper-right coordinates

getXmin()[source]#

Return the min X coordinate

Return type:

float

getYmin()[source]#

Return the min Y coordinate

Return type:

float

getXmax()[source]#

Return the max X coordinate

Return type:

float

getYmax()[source]#

Return the max Y coordinate

Return type:

float

getDx()[source]#

Return the difference of X coordinates

Return type:

float

getDy()[source]#

Return the difference of Y coordinates

Return type:

float

getDimensions()[source]#

Return Dx and Dy

Return type:

tuple[float, float]

Returns:

Tuple with structure : (Dx, Dy)

setXmin(xmin)[source]#

Set Xmin coordinate

Parameters:

xmin (float) – Xmin coordinate

setYmin(ymin)[source]#

Set Ymin coordinate

Parameters:

ymin (float) – Ymin coordinate

setXmax(xmax)[source]#

Set Xmax coordinate

Parameters:

xmax (float) – Xmax coordinate

setYmax(ymax)[source]#

Set Ymax coordinate

Parameters:

ymax (float) – Ymax coordinate

plot(sym='b-', append=<module 'matplotlib.pyplot' from '/home/docs/checkouts/readthedocs.org/user_builds/tracklib/envs/latest/lib/python3.10/site-packages/matplotlib/pyplot.py'>)[source]#

TODO

contains(point)[source]#

Check if a point is in the bbox

Return type:

bool

translate(dx, dy)[source]#

Translation (2D) of shape

Parameters:
  • dx (float) – dx in ground units

  • dy (float) – dy in ground units

rotate(theta)[source]#

Rotation (2D) of shape

Parameters:

theta (float) – angle in radians

scale(h)[source]#

Homothetic transformation (2D) of shape

Parameters:

h (float) – factor

geom()[source]#

Convert to Geometrics (Polygon)

Return type:

Polygon

Returns:

Polygon

toECEFCoords(base=None)[source]#

Coordinate transformation to core.Coords.ECEFCoords

Parameters:

base (Union[ENUCoords, ECEFCoords, GeoCoords, None]) – base coordinates, defaults to None

toGeoCoords(base=None)[source]#

Coordinate transformation to core.Coords.GeoCoords

Parameters:

base (Union[ENUCoords, ECEFCoords, GeoCoords, None]) – base coordinates, defaults to None

toENUCoords(base=None)[source]#

Coordinate transformation to core.Coords.ENUCoords

Parameters:

base (Union[ENUCoords, ECEFCoords, GeoCoords, None]) – base coordinates, defaults to None

addMargin(margin=0.05)[source]#

Adding margin (relative float) to bounding box

Parameters:

margin (float) – margin, defaults to 0.05

asTuple()[source]#

Transform the Bbox object in a tuple of coordinates

Return type:

tuple[float, float, float, float]

Returns:

Tuple of coordinates with this structure (x min, x max, y min, y max)