public class Envelope extends Object
An Envelope
is characterised by the minimum and maximum x and y coordinates. An Envelope
is empty if the set of enclosed points is empty.
An empty Envelope has Double.NaN for min. and max. X and Y coordinates.
Modifier and Type | Field and Description |
---|---|
static Envelope |
EMPTY
An empty
Envelope |
Constructor and Description |
---|
Envelope(double minX,
double minY,
double maxX,
double maxY)
Create an instance using the specified coordinates.
|
Envelope(double minX,
double minY,
double maxX,
double maxY,
CrsId crsId)
Create an instance using the specified coordinates and
CrsId . |
Envelope(Point lowerLeft,
Point upperRight)
Creates an instance from specified lower-left and upper-right
Point s. |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Envelope other)
Checks whether this
Envelope contains the specifies Envelope . |
boolean |
contains(Point p)
Checks whether this
Envelope contains the specifies Envelope . |
boolean |
equals(Object o) |
CrsId |
getCrsId()
Returns the
CrsId for this Envelope |
double |
getHeight()
returns the height of this
Envelope . |
double |
getMaxX()
Return the maximum X-coordinate.
|
double |
getMaxY()
Return the maximum Y-coordinate.
|
double |
getMinX()
Return the minimum X-coordinate.
|
double |
getMinY()
Return the minimum Y-coordinate.
|
double |
getWidth()
returns the width of this
Envelope . |
int |
hashCode() |
Envelope |
intersect(Envelope other)
Intersects the specified
Envelope with this Envelope and returns the result. |
boolean |
intersects(Envelope other)
Checks whether this
Envelope intersects the specifies Envelope . |
boolean |
isEmpty()
Checks whether this
Envelope is empty. |
Point |
lowerLeft()
Returns the lower-left point of this
Envelope . |
Point |
lowerRight()
Returns the lower-right point of this
Envelope . |
String |
toString() |
static Envelope |
union(Envelope b1,
Envelope b2)
Creates an
Envelope that is the set-theoretic union of the specified Envelopes . |
Point |
upperLeft()
Returns the upper-left point of this
Envelope . |
Point |
upperRight()
Returns the upper-right point of this
Envelope . |
boolean |
within(Envelope other)
Checks whether this
Envelope is contained within the specified Envelope |
public static final Envelope EMPTY
Envelope
public Envelope(Point lowerLeft, Point upperRight)
Point
s.lowerLeft
- the Point
designating the lower-left coordinatesupperRight
- the Point
designating the upper-right coordinates
of the envelope.IllegalArgumentException
- if lowerLeft and upperRight have different CrsId
'spublic Envelope(double minX, double minY, double maxX, double maxY)
The CrsId will be UNDEFINED.
minX
- minimum X-coordinateminY
- minimum Y-coordinatemaxX
- minimum Y-coordinatemaxY
- maximum Y-coordinatepublic Envelope(double minX, double minY, double maxX, double maxY, CrsId crsId)
CrsId
.minX
- minimum X-coordinateminY
- minimum Y-coordinatemaxX
- minimum Y-coordinatemaxY
- maximum Y-coordinatecrsId
- the CrsId
that identifies the CoordinateReferenceSystem
for the coordinates
of the envelope.public CrsId getCrsId()
CrsId
for this Envelope
public double getMinX()
public double getMinY()
public double getMaxX()
public double getMaxY()
public double getWidth()
Envelope
.Envelope
's widthpublic double getHeight()
Envelope
.Envelope
's heightpublic Point lowerLeft()
Envelope
.public Point upperRight()
Envelope
.public Point upperLeft()
Envelope
.public Point lowerRight()
Envelope
.public static Envelope union(Envelope b1, Envelope b2)
Envelope
that is the set-theoretic union of the specified Envelopes
.b1
- first operandb2
- second operandEnvelope
that encompasses both operands.IllegalArgumentException
- when the operand Envelope
s don't have the same coordinate reference system.public Envelope intersect(Envelope other)
Envelope
with this Envelope
and returns the result.other
- the Envelope to intersect with this instanceIllegalArgumentException
- when the specified Envelope
doesn't have the same coordinate reference system as this instance.public boolean isEmpty()
Envelope
is empty.public boolean within(Envelope other)
Envelope
is contained within the specified Envelope
other
- the other Envelope
Envelope
IllegalArgumentException
- when the specified Envelope
doesn't have the same coordinate reference system as this instance.public boolean contains(Envelope other)
Envelope
contains the specifies Envelope
.other
- the other Envelope
Envelope
IllegalArgumentException
- when the specified Envelope
doesn't have the same coordinate reference system as this instance.public boolean contains(Point p)
Envelope
contains the specifies Envelope
.p
- the Point
Point
IllegalArgumentException
- when the specified Point
doesn't have the same coordinate reference system as this instance.public boolean intersects(Envelope other)
Envelope
intersects the specifies Envelope
.
Two instances intersect when their set-theoretic intersection is non-empty.
other
- the other Envelope
Envelope
IllegalArgumentException
- when the specified Envelope
doesn't have the same coordinate reference system as this instance.Copyright © 2015 geolatte.org. All rights reserved.