Package sabx10 :: Package oxm :: Module geom :: Class Box
[hide private]
[frames] | no frames]

Class Box

source code

object --+
         |
        Box
Known Subclasses:

A rectangle, represented by bottom left and top right corners.

Instance Methods [hide private]
 
__init__(self, min_lat=200.0, min_lon=200.0, max_lat=-200.0, max_lon=-200.0)
Save the passed-in data.
source code
float
width(self)
Calculate the width, in statue miles.
source code
float
height(self)
Calculate the height, in statue miles.
source code
float
area(self)
Calculate the area, in square statue miles.
source code
boolean
is_pt_in_box(self, lat, lon)
Is the point (lat,lon) in this box?
source code
 
resize(self, new_width, new_height)
Redo the corner points of this box to reflect new width and height, maintaining the same center point as this box currently has.
source code
 
expand_to_point(self, lat, lon)
Expand this box to include the point (lat,lon).
source code
 
expand_to_box(self, box)
Expand this box to include the corners of the given box.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
float max_lat
maximum latitude (top edge in northern hemisphere)
float max_lon
maximum longitude (right edge in western hemisphere)
float min_lat
minimum latitude (bottom edge in northern hemisphere)
float min_lon
minimum longitude (left edge in western hemisphere)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, min_lat=200.0, min_lon=200.0, max_lat=-200.0, max_lon=-200.0)
(Constructor)

source code 

Save the passed-in data.

Parameters:
  • min_lat (float) - minimum latitude (bottom edge in northern hemisphere)
  • min_lon (float) - minimum longitude (left edge in western hemisphere)
  • max_lat (float) - maximum latitude (top edge in northern hemisphere)
  • max_lon (float) - maximum longitude (right edge in western hemisphere)
Overrides: object.__init__

width(self)

source code 

Calculate the width, in statue miles.

Returns: float
width, in statute miles

height(self)

source code 

Calculate the height, in statue miles.

Returns: float
height, in statute miles

area(self)

source code 

Calculate the area, in square statue miles.

Returns: float
area, in square miles

is_pt_in_box(self, lat, lon)

source code 

Is the point (lat,lon) in this box?

Parameters:
  • lat (float) - latitude
  • lon (float) - longitude
Returns: boolean
True or False

resize(self, new_width, new_height)

source code 

Redo the corner points of this box to reflect new width and height, maintaining the same center point as this box currently has.

Parameters:
  • new_width (float) - new width of box
  • new_height (float) - new height of box

expand_to_point(self, lat, lon)

source code 

Expand this box to include the point (lat,lon).

Parameters:
  • lat (float) - latitude of point to include
  • lon (float) - longitude of point to include

expand_to_box(self, box)

source code 

Expand this box to include the corners of the given box.

Parameters:
  • box (Box) - box to expand to