#include <geos.h>
Public Types | |
typedef std::auto_ptr< Envelope > | AutoPtr |
Public Member Functions | |
Envelope (void) | |
Creates a null Envelope . | |
Envelope (double x1, double x2, double y1, double y2) | |
Creates an Envelope for a region defined by maximum and minimum values. | |
Envelope (const Coordinate &p1, const Coordinate &p2) | |
Creates an Envelope for a region defined by two Coordinates. | |
Envelope (const Coordinate &p) | |
Creates an Envelope for a region defined by a single Coordinate. | |
Envelope (const Envelope &env) | |
Copy constructor. | |
Envelope & | operator= (const Envelope &e) |
Assignment operator. | |
Envelope (const std::string &str) | |
Create an Envelope from an Envelope string representation produced by Envelope.toString(). | |
void | init (void) |
Initialize to a null Envelope . | |
void | init (double x1, double x2, double y1, double y2) |
Initialize an Envelope for a region defined by maximum and minimum values. | |
void | init (const Coordinate &p1, const Coordinate &p2) |
Initialize an Envelope to a region defined by two Coordinates. | |
void | init (const Coordinate &p) |
Initialize an Envelope to a region defined by a single Coordinate. | |
void | setToNull (void) |
Makes this Envelope a "null" envelope, that is, the envelope of the empty geometry. | |
bool | isNull (void) const |
Returns true if this Envelope is a "null" envelope. | |
double | getWidth (void) const |
Returns the difference between the maximum and minimum x values. | |
double | getHeight (void) const |
Returns the difference between the maximum and minimum y values. | |
double | getArea () const |
double | getMaxY () const |
double | getMaxX () const |
double | getMinY () const |
double | getMinX () const |
bool | centre (Coordinate ¢re) const |
bool | intersection (const Envelope &env, Envelope &result) const |
void | translate (double transX, double transY) |
Translates this envelope by given amounts in the X and Y direction. | |
void | expandBy (double deltaX, double deltaY) |
Expands this envelope by a given distance in all directions. Both positive and negative distances are supported. | |
void | expandBy (double distance) |
Expands this envelope by a given distance in all directions. Both positive and negative distances are supported. | |
void | expandToInclude (const Coordinate &p) |
Enlarges the boundary of the Envelope so that it contains p. Does nothing if p is already on or within the boundaries. | |
void | expandToInclude (double x, double y) |
Enlarges the boundary of the Envelope so that it contains (x,y). Does nothing if (x,y) is already on or within the boundaries. | |
void | expandToInclude (const Envelope *other) |
Enlarges the boundary of the Envelope so that it contains other . Does nothing if other is wholly on or within the boundaries. | |
bool | contains (const Envelope &other) const |
Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). | |
bool | contains (const Envelope *other) const |
bool | contains (const Coordinate &p) const |
Returns true if the given point lies in or on the envelope. | |
bool | contains (double x, double y) const |
Returns true if the given point lies in or on the envelope. | |
bool | intersects (const Coordinate &p) const |
bool | intersects (double x, double y) const |
bool | intersects (const Envelope *other) const |
bool | intersects (const Envelope &other) const |
bool | covers (double x, double y) const |
bool | covers (const Coordinate *p) const |
bool | covers (const Envelope &other) const |
bool | covers (const Envelope *other) const |
bool | equals (const Envelope *other) const |
Returns true if the Envelope other spatially equals this Envelope . | |
std::string | toString (void) const |
Returns a string of the form Env[minx:maxx,miny:maxy] . | |
double | distance (const Envelope *env) const |
Computes the distance between this and another Envelope . | |
int | hashCode () const |
Static Public Member Functions | |
bool | intersects (const Coordinate &p1, const Coordinate &p2, const Coordinate &q) |
Test the point q to see whether it intersects the Envelope defined by p1-p2. | |
bool | intersects (const Coordinate &p1, const Coordinate &p2, const Coordinate &q1, const Coordinate &q2) |
Test the envelope defined by p1-p2 for intersection with the envelope defined by q1-q2. |
It is often used to represent the bounding box of a Geometry, e.g. the minimum and maximum x and y values of the Coordinates.
Note that Envelopes support infinite or half-infinite regions, by using the values of Double_POSITIVE_INFINITY
and Double_NEGATIVE_INFINITY
.
When Envelope objects are created or initialized, the supplies extent values are automatically sorted into the correct order.
|
Creates an
|
|
Creates an
|
|
Creates an Envelope for a region defined by a single Coordinate.
|
|
Computes the coordinate of the centre of this envelope (as long as it is non-null)
|
|
Returns
|
|
Returns
|
|
Tests if the
Note that this is not the same definition as the SFS
|
|
Tests if the
|
|
Tests if the given point lies in or on the envelope.
|
|
Tests if the given point lies in or on the envelope.
|
|
Computes the distance between this and another The distance between overlapping Envelopes is 0. Otherwise, the distance is the Euclidean distance between the closest points. |
|
Returns
|
|
Expands this envelope by a given distance in all directions. Both positive and negative distances are supported.
|
|
Expands this envelope by a given distance in all directions. Both positive and negative distances are supported.
|
|
Enlarges the boundary of the Envelope so that it contains
|
|
Enlarges the boundary of the Envelope so that it contains (x,y). Does nothing if (x,y) is already on or within the boundaries.
|
|
Enlarges the boundary of the Envelope so that it contains p. Does nothing if p is already on or within the boundaries.
|
|
Gets the area of this envelope.
|
|
Returns the difference between the maximum and minimum y values.
|
|
Returns the Envelope maximum x-value. min x > max x indicates that this is a null Envelope. |
|
Returns the Envelope maximum y-value. min y > max y indicates that this is a null Envelope. |
|
Returns the Envelope minimum x-value. min x > max x indicates that this is a null Envelope. |
|
Returns the Envelope minimum y-value. min y > max y indicates that this is a null Envelope. |
|
Returns the difference between the maximum and minimum x values.
|
|
Initialize an
|
|
Initialize an
|
|
Initialize an
|
|
Computes the intersection of two Envelopes
|
|
Check if the region defined by other Envelope intersects (intersects) the region of this Envelope.
|
|
Check if the point (x, y) intersects (lies inside) the region of this Envelope.
|
|
Check if the point p intersects (lies inside) the region of this Envelope.
|
|
Test the envelope defined by p1-p2 for intersection with the envelope defined by q1-q2.
|
|
Test the point q to see whether it intersects the Envelope defined by p1-p2.
|
|
Returns
|
|
Returns a
|
|
Translates this envelope by given amounts in the X and Y direction.
|