Skip to main content
`Ctrl`+`K`

# Bbox

class tracklib.core.Bbox.Bbox(ll, ur)

  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
  `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]) | 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)

    Constructor of `Bbox`

    Parameters

      - ll (`Union`[`ENUCoords`, `GeoCoords`]) – lower left point

      - ur (`Union`[`ENUCoords`, `GeoCoords`]) – upper right point

  __str__()

    String representation of `Bbox`

    Return type

      `str`

    Returns

      String representation of bbox

  copy()

    Copy the current object

    Return type

      `Bbox`

    Returns

      Copy of bbox

  getLowerLeft()

    Return the lower-left coordinates of `Bbox`

    Return type

      `Union`[`ENUCoords`, `GeoCoords`]

    Returns

      Lower-left coordinates

  getUpperRight()

    Return the upper-right coordinates of `Bbox`

    Return type

      `Union`[`ENUCoords`, `GeoCoords`]

    Returns

      Upper-right coordinates

  getXmin()

    Return the min X coordinate

    Return type

      `float`

  getYmin()

    Return the min Y coordinate

    Return type

      `float`

  getXmax()

    Return the max X coordinate

    Return type

      `float`

  getYmax()

    Return the max Y coordinate

    Return type

      `float`

  getDx()

    Return the difference of X coordinates

    Return type

      `float`

  getDy()

    Return the difference of Y coordinates

    Return type

      `float`

  getDimensions()

    Return Dx and Dy

    Return type

      `tuple`[`float`, `float`]

    Returns

      Tuple with structure : (Dx, Dy)

  setXmin(xmin)

    Set Xmin coordinate

    Parameters

      xmin (`float`) – Xmin coordinate

  setYmin(ymin)

    Set Ymin coordinate

    Parameters

      ymin (`float`) – Ymin coordinate

  setXmax(xmax)

    Set Xmax coordinate

    Parameters

      xmax (`float`) – Xmax coordinate

  setYmax(ymax)

    Set Ymax coordinate

    Parameters

      ymax (`float`) – Ymax coordinate

  plot(sym='b-')

    TODO

  contains(point)

    Check if a point is in the bbox

    Return type

      `bool`

  translate(dx, dy)

    Translation (2D) of shape

    Parameters

      - dx (`float`) – dx in ground units

      - dy (`float`) – dy in ground units

  rotate(theta)

    Rotation (2D) of shape

    Parameters

      theta (`float`) – angle in radians

  scale(h)

    Homothetic transformation (2D) of shape

    Parameters

      h (`float`) – factor

  geom()

    Convert to Geometrics (Polygon)

    Return type

      `Polygon`

    Returns

      Polygon

  toECEFCoords(base=None)

    Coordinate transformation to `core.Coords.ECEFCoords`

    Parameters

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

  toGeoCoords(base=None)

    Coordinate transformation to `core.Coords.GeoCoords`

    Parameters

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

  toENUCoords(base=None)

    Coordinate transformation to `core.Coords.ENUCoords`

    Parameters

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

  addMargin(margin=0.05)

    Adding margin (relative float) to bounding box

    Parameters

      margin (`float`) – margin, defaults to 0.05

  asTuple()

    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)