Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
com.vividsolutions.jts.geom.Envelope
public class Envelope
extends java.lang.Object
implements Serializable
Geometry
,
e.g. the minimum and maximum x and y values of the Coordinate
s.
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.
Constructor Summary | |
| |
| |
| |
|
Method Summary | |
boolean |
|
boolean | |
boolean |
|
double | |
boolean |
|
void |
|
void |
|
void |
|
double |
|
double |
|
double |
|
double |
|
double |
|
double |
|
int |
|
void |
|
void |
|
void |
|
void | |
void |
|
boolean |
|
static boolean |
|
static boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean | |
boolean |
|
void |
|
String |
|
public Envelope()
Creates a nullEnvelope
.
public Envelope(Coordinate p)
Creates anEnvelope
for a region defined by a single Coordinate.
- Parameters:
public Envelope(Coordinate p1, Coordinate p2)
Creates anEnvelope
for a region defined by two Coordinates.
- Parameters:
p1
- the first Coordinatep2
- the second Coordinate
public Envelope(Envelope env)
Create anEnvelope
from an existing Envelope.
- Parameters:
env
- the Envelope to initialize from
public Envelope(double x1, double x2, double y1, double y2)
Creates anEnvelope
for a region defined by maximum and minimum values.
- Parameters:
x1
- the first x-valuex2
- the second x-valuey1
- the first y-valuey2
- the second y-value
public boolean contains(Coordinate p)
Returnstrue
if the given point lies in or on the envelope.
- Parameters:
p
- the point which thisEnvelope
is being checked for containing
- Returns:
true
if the point lies in the interior or on the boundary of thisEnvelope
.
public boolean contains(Envelope other)
Returnstrue
if theEnvelope other
lies wholely inside thisEnvelope
(inclusive of the boundary).
- Parameters:
other
- theEnvelope
which thisEnvelope
is being checked for containing
- Returns:
true
ifother
is contained in thisEnvelope
public boolean contains(double x, double y)
Returnstrue
if the given point lies in or on the envelope.
- Parameters:
x
- the x-coordinate of the point which thisEnvelope
is being checked for containingy
- the y-coordinate of the point which thisEnvelope
is being checked for containing
- Returns:
true
if(x, y)
lies in the interior or on the boundary of thisEnvelope
.
public double distance(Envelope env)
Computes the distance between this and anotherEnvelope
. The distance between overlapping Envelopes is 0. Otherwise, the distance is the Euclidean distance between the closest points.
public boolean equals(Object other)
public void expandToInclude(Coordinate p)
Enlarges the boundary of theEnvelope
so that it contains (x,y). Does nothing if (x,y) is already on or within the boundaries.
- Parameters:
public void expandToInclude(Envelope other)
Enlarges the boundary of theEnvelope
so that it containsother
. Does nothing ifother
is wholly on or within the boundaries.
- Parameters:
other
- theEnvelope
to merge with
public void expandToInclude(double x, double y)
Enlarges the boundary of theEnvelope
so that it contains (x,y). Does nothing if (x,y) is already on or within the boundaries.
- Parameters:
x
- the value to lower the minimum x to or to raise the maximum x toy
- the value to lower the minimum y to or to raise the maximum y to
public double getHeight()
Returns the difference between the maximum and minimum y values.
- Returns:
- max y - min y, or 0 if this is a null
Envelope
public double getMaxX()
Returns theEnvelope
s maximum x-value. min x > max x indicates that this is a nullEnvelope
.
- Returns:
- the maximum x-coordinate
public double getMaxY()
Returns theEnvelope
s maximum y-value. min y > max y indicates that this is a nullEnvelope
.
- Returns:
- the maximum y-coordinate
public double getMinX()
Returns theEnvelope
s minimum x-value. min x > max x indicates that this is a nullEnvelope
.
- Returns:
- the minimum x-coordinate
public double getMinY()
Returns theEnvelope
s minimum y-value. min y > max y indicates that this is a nullEnvelope
.
- Returns:
- the minimum y-coordinate
public double getWidth()
Returns the difference between the maximum and minimum x values.
- Returns:
- max x - min x, or 0 if this is a null
Envelope
public int hashCode()
public void init()
Initialize to a nullEnvelope
.
public void init(Coordinate p)
Initialize anEnvelope
to a region defined by a single Coordinate.
- Parameters:
public void init(Coordinate p1, Coordinate p2)
Initialize anEnvelope
to a region defined by two Coordinates.
- Parameters:
p1
- the first Coordinatep2
- the second Coordinate
public void init(Envelope env)
Initialize anEnvelope
from an existing Envelope.
- Parameters:
env
- the Envelope to initialize from
public void init(double x1, double x2, double y1, double y2)
Initialize anEnvelope
for a region defined by maximum and minimum values.
- Parameters:
x1
- the first x-valuex2
- the second x-valuey1
- the first y-valuey2
- the second y-value
public boolean intersects(Coordinate p)
Check if the pointp
overlaps (lies inside) the region of thisEnvelope
.
- Parameters:
- Returns:
true
if the point overlaps thisEnvelope
public static boolean intersects(Coordinate p1, Coordinate p2, Coordinate q)
Test the point q to see whether it intersects the Envelope defined by p1-p2
- Parameters:
p1
- one extremal point of the envelopep2
- another extremal point of the envelopeq
- the point to test for intersection
- Returns:
true
if q intersects the envelope p1-p2
public static boolean intersects(Coordinate p1, Coordinate p2, Coordinate q1, Coordinate q2)
Test the envelope defined by p1-p2 for intersection with the envelope defined by q1-q2
- Parameters:
p1
- one extremal point of the envelope Pp2
- another extremal point of the envelope Pq1
- one extremal point of the envelope Qq2
- another extremal point of the envelope Q
- Returns:
true
if Q intersects P
public boolean intersects(Envelope other)
Check if the region defined byother
overlaps (intersects) the region of thisEnvelope
.
- Parameters:
other
- theEnvelope
which thisEnvelope
is being checked for overlapping
- Returns:
true
if theEnvelope
s overlap
public boolean intersects(double x, double y)
Check if the point(x, y)
overlaps (lies inside) the region of thisEnvelope
.
- Parameters:
x
- the x-ordinate of the pointy
- the y-ordinate of the point
- Returns:
true
if the point overlaps thisEnvelope
public boolean isNull()
Returnstrue
if thisEnvelope
is a "null" envelope.
- Returns:
true
if thisEnvelope
is uninitialized or is the envelope of the empty geometry.
public boolean overlaps(Envelope other)
Deprecated. Use #intersects instead. In the future, #overlaps may be changed to be a true overlap check; that is, whether the intersection is two-dimensional.
public boolean overlaps(double x, double y)
Deprecated. Use #intersects instead.
public void setToNull()
Makes thisEnvelope
a "null" envelope, that is, the envelope of the empty geometry.
public String toString()