| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
??.instance --+
|
Envelope
Represents a spatial envelope (i.e. bounding box).
Following operators are defined for Envelope:
Addition:
e1 + e2 is equvalent to e1.expand_to_include(e2) but yields
a new envelope instead of modifying e1
Subtraction:
Currently e1 - e2 returns e1.
Multiplication and division with floats:
Multiplication and division change the width and height of the envelope
by the given factor without modifying its center..
That is, e1 * x is equivalent to:
e1.width(x * e1.width())
e1.height(x * e1.height()),
except that a new envelope is created instead of modifying e1.
e1 / x is equivalent to e1 * (1.0/x).
Equality: two envelopes are equal if their corner points are equal.
| Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from |
|||
| Class Variables | |
__instance_size__ = 40
|
|
__safe_for_unpickling__ = True
|
|
| Properties | |
|
maxx X coordinate for the upper right corner |
|
|
maxy Y coordinate for the upper right corner |
|
|
minx X coordinate for the lower left corner |
|
|
miny Y coordinate for the lower left corner |
|
|
Inherited from |
|
| Method Details |
__add__( (Envelope)arg1, (Envelope)arg2) -> object :
C++ signature :
_object* __add__(mapnik::Envelope<double> {lvalue},mapnik::Envelope<double>)
|
__div__( (Envelope)arg1, (float)arg2) -> object :
C++ signature :
_object* __div__(mapnik::Envelope<double> {lvalue},float)
|
__eq__( (Envelope)arg1, (Envelope)arg2) -> object :
C++ signature :
_object* __eq__(mapnik::Envelope<double> {lvalue},mapnik::Envelope<double>)
|
__getinitargs__( (Envelope)arg1) -> tuple :
C++ signature :
boost::python::tuple __getinitargs__(mapnik::Envelope<double>)
|
__init__( (object)arg1, (float)minx, (float)miny, (float)maxx, (float)maxy) -> None :
Constructs a new envelope from the coordinates
of its lower left and upper right corner points.
C++ signature :
void __init__(_object*,double,double,double,double)
__init__( (object)arg1) -> None :
Equivalent to Envelope(0, 0, -1, -1).
C++ signature :
void __init__(_object*)
__init__( (object)arg1, (Coord)ll, (Coord)ur) -> None :
Equivalent to Envelope(ll.x, ll.y, ur.x, ur.y).
C++ signature :
void __init__(_object*,mapnik::coord<double, 2>,mapnik::coord<double, 2>)
|
__mul__( (Envelope)arg1, (float)arg2) -> object :
C++ signature :
_object* __mul__(mapnik::Envelope<double> {lvalue},float)
|
helper for pickle
|
repr(x)
|
__rmul__( (Envelope)arg1, (float)arg2) -> object :
C++ signature :
_object* __rmul__(mapnik::Envelope<double> {lvalue},float)
|
__sub__( (Envelope)arg1, (Envelope)arg2) -> object :
C++ signature :
_object* __sub__(mapnik::Envelope<double> {lvalue},mapnik::Envelope<double>)
|
center( (Envelope)arg1) -> Coord :
Returns the coordinates of the center of the bounding box.
Example:
>>> e = Envelope(0, 0, 100, 100)
>>> e.center()
Coord(50, 50)
C++ signature :
mapnik::coord<double, 2> center(mapnik::Envelope<double> {lvalue})
center( (Envelope)arg1, (float)x, (float)y) -> None :
Moves the envelope so that the given coordinates become its new center.
The width and the height are preserved.
Example:
>>> e = Envelope(0, 0, 100, 100)
>>> e.center(60, 60)
>>> e.center()
Coord(60.0,60.0)
>>> (e.width(), e.height())
(100.0, 100.0)
>>> e
Envelope(10.0, 10.0, 110.0, 110.0)
C++ signature :
void center(mapnik::Envelope<double> {lvalue},double,double)
|
contains( (Envelope)arg1, (float)x, (float)y) -> bool :
Returns True iff this envelope contains the point
given by x and y.
C++ signature :
bool contains(mapnik::Envelope<double> {lvalue},double,double)
contains( (Envelope)arg1, (Coord)p) -> bool :
Equivalent to contains(p.x, p.y)
C++ signature :
bool contains(mapnik::Envelope<double> {lvalue},mapnik::coord<double, 2>)
contains( (Envelope)arg1, (Envelope)other) -> bool :
Equivalent to:
contains(other.minx, other.miny) and contains(other.maxx, other.maxy)
C++ signature :
bool contains(mapnik::Envelope<double> {lvalue},mapnik::Envelope<double>)
|
expand_to_include( (Envelope)arg1, (float)x, (float)y) -> None :
Expands this envelope to include the point given by x and y.
Example:
C++ signature :
void expand_to_include(mapnik::Envelope<double> {lvalue},double,double)
expand_to_include( (Envelope)arg1, (Coord)p) -> None :
Equivalent to expand_to_include(p.x, p.y)
C++ signature :
void expand_to_include(mapnik::Envelope<double> {lvalue},mapnik::coord<double, 2>)
expand_to_include( (Envelope)arg1, (Envelope)other) -> None :
Equivalent to:
expand_to_include(other.minx, other.miny)
expand_to_include(other.maxx, other.maxy)
C++ signature :
void expand_to_include(mapnik::Envelope<double> {lvalue},mapnik::Envelope<double>)
|
Projects the envelope from the geographic space into the cartesian space by projecting its corner points. See also: Coord.forward(self, projection) |
height( (Envelope)arg1, (float)new_height) -> None :
Sets the height to new_height of the envelope preserving its center.
Example:
>>> e = Envelope(0, 0, 100, 100)
>>> e.height(120)
>>> e.center()
Coord(50.0,50.0)
>>> e
Envelope(0.0, -10.0, 100.0, 110.0)
C++ signature :
void height(mapnik::Envelope<double> {lvalue},double)
height( (Envelope)arg1) -> float :
Returns the height of this envelope.
C++ signature :
double height(mapnik::Envelope<double> {lvalue})
|
intersect( (Envelope)arg1, (Envelope)other) -> Envelope :
Returns the overlap of this envelope and the other envelope
as a new envelope.
Example:
>>> e1 = Envelope(0, 0, 100, 100)
>>> e2 = Envelope(50, 50, 150, 150)
>>> e1.intersect(e2)
Envelope(50.0, 50.0, 100.0, 100.0)
C++ signature :
mapnik::Envelope<double> intersect(mapnik::Envelope<double> {lvalue},mapnik::Envelope<double>)
|
intersects( (Envelope)arg1, (float)x, (float)y) -> bool :
Returns True iff this envelope intersects the point
given by x and y.
Note: For points, intersection is equivalent
to containment, i.e. the following holds:
e.contains(x, y) == e.intersects(x, y)
C++ signature :
bool intersects(mapnik::Envelope<double> {lvalue},double,double)
intersects( (Envelope)arg1, (Coord)p) -> bool :
Equivalent to contains(p.x, p.y)
C++ signature :
bool intersects(mapnik::Envelope<double> {lvalue},mapnik::coord<double, 2>)
intersects( (Envelope)arg1, (Envelope)other) -> bool :
Returns True iff this envelope intersects the other envelope,
This relationship is symmetric.
Example:
>>> e1 = Envelope(0, 0, 100, 100)
>>> e2 = Envelope(50, 50, 150, 150)
>>> e1.intersects(e2)
True
>>> e1.contains(e2)
False
C++ signature :
bool intersects(mapnik::Envelope<double> {lvalue},mapnik::Envelope<double>)
|
Projects the envelope from the cartesian space into the geographic space by projecting its corner points. See also: Coord.inverse(self, projection). |
width( (Envelope)arg1, (float)new_width) -> None :
Sets the width to new_width of the envelope preserving its center.
Example:
>>> e = Envelope(0, 0, 100, 100)
>>> e.width(120)
>>> e.center()
Coord(50.0,50.0)
>>> e
Envelope(-10.0, 0.0, 110.0, 100.0)
C++ signature :
void width(mapnik::Envelope<double> {lvalue},double)
width( (Envelope)arg1) -> float :
Returns the width of this envelope.
C++ signature :
double width(mapnik::Envelope<double> {lvalue})
|
| Property Details |
maxxX coordinate for the upper right corner
|
maxyY coordinate for the upper right corner
|
minxX coordinate for the lower left corner
|
minyY coordinate for the lower left corner
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Sun Nov 8 09:00:49 2009 | http://epydoc.sourceforge.net |