public class Envelope<P extends Position> extends Object
An Envelope
is characterised by a lower-left and an upper-right coordinate.
An Envelope
is empty if the set of enclosed points is empty.
An empty Envelope has Double.NaN for its lowerleft/upperright coordinates.
Constructor and Description |
---|
Envelope(CoordinateReferenceSystem<P> crs)
Creates an empty Envelop
|
Envelope(double minC1,
double minC2,
double maxC1,
double maxC2,
CoordinateReferenceSystem<P> crs)
Create an instance using the specified coordinates and
CoordinateReferenceSystem . |
Envelope(P lowerLeft,
P upperRight,
CoordinateReferenceSystem<P> crs)
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(P p)
Checks whether this
Envelope contains the specifies Envelope . |
boolean |
equals(Object o) |
double |
extentAlongDimension(int i) |
CoordinateReferenceSystem<P> |
getCoordinateReferenceSystem()
Returns the
CoordinateReferenceSystem for this Envelope |
protected double |
getMaxC0() |
protected double |
getMaxC1() |
protected double |
getMinC0() |
protected double |
getMinC1() |
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. |
P |
lowerLeft()
Returns the lower-left point of this
Envelope . |
P |
lowerRight()
Returns the lower-right point of this
Envelope . |
String |
toString() |
Envelope<P> |
union(Envelope<P> other)
Creates an
Envelope that is the set-theoretic union of this Envelope with the specified Envelope |
P |
upperLeft()
Returns the upper-left point of this
Envelope . |
P |
upperRight()
Returns the upper-right point of this
Envelope . |
boolean |
within(Envelope other)
Checks whether this
Envelope is contained within the specified Envelope |
public Envelope(CoordinateReferenceSystem<P> crs)
public Envelope(P lowerLeft, P upperRight, CoordinateReferenceSystem<P> crs)
Point
s.
If the positions have coordinate dimension > 2, the Z/M coordinate values will be
set to 0 in the constructed EnvelopelowerLeft
- the Point
designating the lower-left coordinatesupperRight
- the Point
designating the upper-right coordinates
of the envelope.public Envelope(double minC1, double minC2, double maxC1, double maxC2, CoordinateReferenceSystem<P> crs)
CoordinateReferenceSystem
.
If the CoordinateReferenceSystem
has coordinate dimension > 2, the Z/M coordinate values will be set to 0
in the envelopeminC1
- minimum first coordinateminC2
- minimum second coordinatemaxC1
- maximum first coordinatemaxC2
- maximum second coordinatecrs
- the CoordinateReferenceSystem
for the coordinates
of the envelope.public CoordinateReferenceSystem<P> getCoordinateReferenceSystem()
CoordinateReferenceSystem
for this Envelope
public P lowerLeft()
Envelope
.public P upperRight()
Envelope
.public P upperLeft()
Envelope
.public P lowerRight()
Envelope
.protected double getMinC0()
protected double getMinC1()
protected double getMaxC0()
protected double getMaxC1()
public Envelope<P> union(Envelope<P> other)
Envelope
that is the set-theoretic union of this Envelope
with the specified Envelope
other
- other EnvelopeEnvelope
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 double extentAlongDimension(int i)
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(P 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 © 2018 geolatte.org. All rights reserved.