|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectAbstractEnvelope
CoverageEnvelope
public class CoverageEnvelope
An envelope holding the spatio-temporal extent and preferred resolution of a coverage. The
envelope Coordinate Reference System (CRS) is determined by the CoverageDatabase
instance associated with this object and can not be changed. The CoverageDatabase
may define different CRS, but the following axes can be considered typical:
This class provides convenience methods for fetching and setting the horizontal rectangle, vertical range and temporal range of the envelope.
Conventions
In this class, the lower and upper bounds are both inclusive. This is consistent with OGC/ISO
conventions but different than typical Java conventions, where the upper bounds is often
exclusive.
| coverage/geotk-coverage-sql (download) | View source code for this class |
| Method Summary | |
|---|---|
boolean |
clear()
Resets all envelope attributes to their initial state, which is an infinite envelope. |
CoverageEnvelope |
clone()
Returns a clone of this coverage envelope. |
boolean |
equals(Object other)
Compares this extent with the given object for equality. |
CoordinateReferenceSystem |
getCoordinateReferenceSystem()
Returns the spatio-temporal CRS of this envelope. |
CoordinateReferenceSystem |
getCoordinateReferenceSystem(boolean horizontal,
boolean vertical,
boolean temporal)
Returns the CRS of this envelope containing only the requested dimensions. |
int |
getDimension()
Returns the number of dimension in this envelope, which is usually 4. |
Rectangle2D |
getHorizontalRange()
Returns the horizontal bounding box of the elements to be read. |
double |
getLower(int dimension)
Returns the minimal ordinate along the specified dimension. |
double |
getMedian(int dimension)
Returns the median ordinate along the specified dimension. |
Dimension |
getPreferredImageSize()
Returns the approximative size of the desired image, or null if unknown. |
Dimension2D |
getPreferredResolution()
Returns the approximative resolution desired, or null for best resolution. |
double |
getSpan(int dimension)
Returns the envelope span along the specified dimension. |
DateRange |
getTimeRange()
Returns the time range of the elements to be read. |
double |
getUpper(int dimension)
Returns the maximal ordinate along the specified dimension. |
NumberRange<Double> |
getVerticalRange()
Returns the vertical range of the elements to be read. |
int |
hashCode()
Returns a hash code value for this extent. |
boolean |
setEnvelope(Envelope envelope)
Sets the spatio-temporal envelope. |
boolean |
setHorizontalRange(Rectangle2D area)
Sets the horizontal bounding box of the elements to be read. |
boolean |
setPreferredImageSize(Dimension size)
Sets the approximative size of the desired image. |
boolean |
setPreferredResolution(Dimension2D resolution)
Sets the preferred resolution in units of the horizontal envelope. |
boolean |
setTimeRange(Date startTime,
Date endTime)
Sets the time range of the elements to be read by this table. |
boolean |
setTimeRange(DateRange timeRange)
Sets the time range of the elements to be read. |
boolean |
setVerticalRange(double minimum,
double maximum)
Sets the vertical range of the elements to be read. |
boolean |
setVerticalRange(NumberRange<?> range)
Sets the vertical range of the elements to be read. |
| Methods inherited from class AbstractEnvelope |
|---|
castOrCopy, contains, contains, equals, getLowerCorner, getMaximum, getMedian, getMinimum, getSpan, getUpperCorner, intersects, isEmpty, isNull, toPolygonString, toRectangle2D, toString |
| Methods inherited from class Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public boolean clear()
true if this envelope changed as a result of this method call.public CoordinateReferenceSystem getCoordinateReferenceSystem()
getCoordinateReferenceSystem in interface Envelope
public CoordinateReferenceSystem getCoordinateReferenceSystem(boolean horizontal,
boolean vertical,
boolean temporal)
true, then the returned CRS will contain the corresponding dimension if the
database CRS has such dimension. If an argument is false, then the returned CRS
is guaranteed to not have the corresponding dimension. If all arguments are false,
then this method returns null.
horizontal - false for excluding the horizontal component in the returned CRS.vertical - false for excluding the vertical component in the returned CRS.temporal - false for excluding the temporal component in the returned CRS.
false argument value,
or null if there is no CRS for the remaining components.public int getDimension()
getDimension in interface Envelope
public boolean setEnvelope(Envelope envelope)
throws TransformException
setHorizontalRange(Rectangle2D), setVerticalRange(NumberRange)
and setTimeRange(DateRange), applying a coordinate transformation if needed.
If the given envelope has more dimensions than this
envelope dimension, then the extra dimensions will be ignored.
If the given envelope has less dimensions, then the CoverageEnvelope dimensions not
present in the given envelope will be left unchanged.
Example: If the given envelope is two-dimensional and its CRS is horizontal,
then only the setHorizontalRange(Rectangle2D) method will be invoked on this
CoverageEnvelope - the vertical and temporal ordinate values will be unchanged.
envelope - The envelope, or null to reset to full coverage.
true if the envelope changed as a result of this call, or
false if the specified envelope is equals to the one already set.
TransformException - if an error occurred during coordinate transformation.public Rectangle2D getHorizontalRange()
getVerticalRange(),
getTimeRange()public boolean setHorizontalRange(Rectangle2D area)
area - The horizontal bounding box of the elements to be read.
true if the bounding box changed as a result of this call, or
false if the specified box is equals to the one already set.public NumberRange<Double> getVerticalRange()
getHorizontalRange(),
getTimeRange()public final boolean setVerticalRange(NumberRange<?> range)
setVerticalRange(double, double).
range - The vertical range, or null for full coverage.
true if the vertical range changed as a result of this call, or
false if the specified range is equals to the one already set.
public boolean setVerticalRange(double minimum,
double maximum)
minimum - The minimal z value, inclusive.maximum - The maximal z value, inclusive.
true if the vertical range changed as a result of this call, or
false if the specified range is equals to the one already set.public DateRange getTimeRange()
getHorizontalRange(),
getVerticalRange()public final boolean setTimeRange(DateRange timeRange)
setTimeRange(Date, Date).
timeRange - The time range.
true if the time range changed as a result of this call, or
false if the specified range is equals to the one already set.
public boolean setTimeRange(Date startTime,
Date endTime)
startTime - The start time, inclusive.endTime - The end time, inclusive.
true if the time range changed as a result of this call, or
false if the specified range is equals to the one already set.public Dimension2D getPreferredResolution()
null for best resolution.
The units are the same than for the horizontal envelope.
null for the best resolution available.public boolean setPreferredResolution(Dimension2D resolution)
resolution - The preferred geographic resolution, or null for best resolution.
true if the resolution changed as a result of this call, or
false if the specified resolution is equals to the one already set.public Dimension getPreferredImageSize()
null if unknown.
This is computed from the horizontal range and
the preferred resolution.
null if the size can not be computed.
public boolean setPreferredImageSize(Dimension size)
throws IllegalStateException
The setHorizontalRange(Rectangle2D) or setEnvelope(Envelope) method
must have been invoked with a finite envelope before this setPreferredImageSize
method. The previous preferred resolution, if any, is discarded.
size - The new preferred image size, or null.
true if the resolution changed as a result of this call, or
false if the specified resolution is equals to the one computed
by this method.
IllegalStateException - If the current horizontal range is not finite.
public double getLower(int dimension)
throws IndexOutOfBoundsException
getLower in class AbstractEnvelopedimension - The dimension for which to obtain the ordinate value.
IndexOutOfBoundsException - If the given index is negative or is equals or greater
than the envelope dimension.
public double getUpper(int dimension)
throws IndexOutOfBoundsException
getUpper in class AbstractEnvelopedimension - The dimension for which to obtain the ordinate value.
IndexOutOfBoundsException - If the given index is negative or is equals or greater
than the envelope dimension.
public double getMedian(int dimension)
throws IndexOutOfBoundsException
getMedian in interface EnvelopegetMedian in class AbstractEnvelopedimension - The dimension for which to obtain the ordinate value.
IndexOutOfBoundsException - If the given index is negative or is equals or greater
than the envelope dimension.
public double getSpan(int dimension)
throws IndexOutOfBoundsException
getSpan in interface EnvelopegetSpan in class AbstractEnvelopedimension - The dimension for which to obtain the ordinate value.
IndexOutOfBoundsException - If the given index is negative or is equals or greater
than the envelope dimension.public CoverageEnvelope clone()
clone in class ObjectObject.clone()public int hashCode()
hashCode in class AbstractEnvelopepublic boolean equals(Object other)
equals in class AbstractEnvelopeother - The object to compare with this one.
true if the given object is equal to this envelope.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||