Module eoxserver.core.util.bbox

This module contains definition of the auxiliary 2D bounding box class.

class eoxserver.core.util.bbox.BBox(sx=None, sy=None, ox=0, oy=0, ux=0, uy=0)

Simple 2D bounding box primitive.

Possible initializations:

  • size and zerro offset BBox(sx,sy)
  • size and offset (lower corner) BBox(sx,sy,ox,oy)
  • lower and upper corners BBox(None,None,ox,oy,ux,uy)

BBox class supports following operators:

& - area intersection (maximum common area) | - area expansion (minimum area contaning both boxes) + - offset translation (adding vector to current value) - - offset translation (substracting vector from current value)
__and__(other)

operator - intersection

__or__(other)

operator - expansion

__add__()

operator - offset translation

__sub__()

operator - offset translation

as_tuple()

Get bbounding box as (sx.sy,ox,oy) tuple

cup

upper corner tuple (RO)

ext

extent/box area (RO)

off

offset tuple (RO)

ox

x offset/lower corner (RO)

oy

y offset/lower corner (RO)

size

size tuple (RO)

sx

x size (RO)

sy

y size (RO)

ux

x upper corner (RO)

uy

y upper corner (RO)