public class Envelope<P extends Position> extends Object
An Envelope determines a 2D area characterised by a lower-left and an upper-right coordinate.
An Envelope is empty if the set of enclosed points are empty, and 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
Points. |
| Modifier and Type | Method and Description |
|---|---|
<Q extends Position> |
as(Class<Q> castToType) |
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<P> |
intersect(Envelope<P> other)
Intersects the specified
Envelope with this Envelope and returns the result. |
boolean |
intersects(Envelope<P> 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. |
double[] |
toArray()
Returns the lowerleft and upperright coordinates in 2D for 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<P> 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)
Points.
If the positions have coordinate dimension higher than 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 higher than 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 Envelopepublic P lowerLeft()
Envelope.public P upperRight()
Envelope.public P upperLeft()
Envelope.public P lowerRight()
Envelope.public double[] toArray()
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 Envelopeother - other EnvelopeEnvelope that encompasses both operands.IllegalArgumentException - when the operand Envelopes don't have the same coordinate reference system.public Envelope<P> intersect(Envelope<P> 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<P> other)
Envelope is contained within the specified Envelopeother - the other EnvelopeEnvelopeIllegalArgumentException - 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 EnvelopeEnvelopeIllegalArgumentException - 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 PointPointIllegalArgumentException - when the specified Point doesn't have the same coordinate reference system as this instance.public boolean intersects(Envelope<P> other)
Envelope intersects the specifies Envelope.
Two instances intersect when their set-theoretic intersection is non-empty.
other - the other EnvelopeEnvelopeIllegalArgumentException - when the specified Envelope doesn't have the same coordinate reference system as this instance.Copyright © 2023 geolatte.org. All rights reserved.