|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectAbstractEnvelope
public abstract class AbstractEnvelope
Base class for envelope implementations. This base class
provides default implementations for toString(), equals(Object)
and hashCode() methods.
This class do not holds any state. The decision to implement Serializable
or Cloneable interfaces is left to implementors.
| referencing/geotk-referencing (download) | View source code for this class |
| Constructor Summary | |
|---|---|
protected |
AbstractEnvelope()
Constructs an envelope. |
| Method Summary | |
|---|---|
boolean |
equals(Envelope envelope,
double eps,
boolean epsIsRelative)
Compares to the specified envelope for equality up to the specified tolerance value. |
boolean |
equals(Object object)
Returns true if the specified object is an envelope of the same class
with equals coordinates and CRS. |
DirectPosition |
getLowerCorner()
A coordinate position consisting of all the minimal ordinates. |
DirectPosition |
getUpperCorner()
A coordinate position consisting of all the maximal ordinates. |
int |
hashCode()
Returns a hash value for this envelope. |
static String |
toPolygonString(Envelope envelope)
Formats a POLYGON element from an envelope. |
String |
toString()
Formats this envelope in the Well Known Text (WKT) format. |
static String |
toString(Envelope envelope)
Formats a BOX element from an envelope. |
| Methods inherited from class Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface Envelope |
|---|
getCoordinateReferenceSystem, getDimension, getMaximum, getMedian, getMinimum, getSpan |
| Constructor Detail |
|---|
protected AbstractEnvelope()
| Method Detail |
|---|
public DirectPosition getLowerCorner()
getLowerCorner in interface Envelopepublic DirectPosition getUpperCorner()
getUpperCorner in interface Envelopepublic String toString()
The output of this method can be parsed by theBOXnD(lower corner,upper corner)
GeneralEnvelope constructor.
toString in class Objectpublic static String toString(Envelope envelope)
BOX element from an envelope. This method formats the given envelope in
the Well Known Text (WKT) format. The output is like below, where n
is the number of dimensions:
The output of this method can be parsed by theBOXnD(lower corner,upper corner)
GeneralEnvelope constructor.
envelope - The envelope to format.
BOX2D or BOX3D in WKT format.GeneralEnvelope.GeneralEnvelope(String),
CoordinateFormat,
org.geotoolkit.io.wktpublic static String toPolygonString(Envelope envelope)
POLYGON element from an envelope. This method formats the given envelope
as a geometry in the Well Known Text (WKT) format. This is provided as an
alternative to the BOX element formatted by toString(Envelope), because
the BOX element is usually not considered a geometry while POLYGON is.
The output of this method can be parsed
by the GeneralEnvelope constructor.
envelope - The envelope to format.
POLYGON in WKT format.org.geotoolkit.io.wktpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object object)
true if the specified object is an envelope of the same class
with equals coordinates and CRS.
Note:
This implementation requires that the provided object argument
is of the same class than this envelope. We do not relax this rule since not every
implementations in the Geotk code base follow the same contract.
equals in class Objectobject - The object to compare with this envelope.
true if the given object is equal to this envelope.
public boolean equals(Envelope envelope,
double eps,
boolean epsIsRelative)
eps can be either relative to the envelope span along each dimension or can be an absolute value (as for example some
ground resolution of a grid coverage).
If epsIsRelative is set to true, the actual tolerance value for a given
dimension i is eps×span where span is the
maximum of this envelope span and the specified envelope length
along dimension i.
If epsIsRelative is set to false, the actual tolerance value for a
given dimension i is eps.
Relative tolerance value (as opposed to absolute tolerance value) help to workaround the fact that tolerance value are CRS dependent. For example the tolerance value need to be smaller for geographic CRS than for UTM projections, because the former typically has a range of -180 to 180° while the later can have a range of thousands of meters.
Note: This method assumes that the specified envelope uses the same CRS than this envelope. For performance reason, it will no be verified unless Java assertions are enabled.
envelope - The envelope to compare with.eps - The tolerance value to use for numerical comparisons.epsIsRelative - true if the tolerance value should be relative to
axis length, or false if it is an absolute value.
true if the given object is equal to this envelope up to the given
tolerance value.GeneralEnvelope.contains(Envelope, boolean),
GeneralEnvelope.intersects(Envelope, boolean)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||