GeneralEnvelope
.@Deprecated public class GeneralEnvelope extends GeneralEnvelope implements Cloneable
This class is kept as a workaround for the "not yet working" GeneralEnvelope(GeographicBoundingBox)
constructor in the Apache SIS class, and for some methods not yet ported to SIS (because of uncertain value).
Note that the reorderCorners()
method in Geotk has been renamed simplify()
in SIS,
and reduceToDomain(false)
has been renamed as normalize()
.
referencing/geotkreferencing (download) 
Constructor and Description 

GeneralEnvelope(CoordinateReferenceSystem crs)
Deprecated.
Constructs an empty envelope with the specified coordinate reference system.

GeneralEnvelope(Envelope envelope)
Deprecated.
Constructs a new envelope with the same data than the specified envelope.

GeneralEnvelope(GeographicBoundingBox box)
Deprecated.
Constructs a new envelope with the same data than the specified
geographic bounding box.

GeneralEnvelope(GridEnvelope gridEnvelope,
PixelInCell anchor,
MathTransform gridToCRS,
CoordinateReferenceSystem crs)
Deprecated.
Constructs a georeferenced envelope from a grid envelope transformed using the specified
math transform.

GeneralEnvelope(Rectangle2D rect)
Deprecated.
Constructs twodimensional envelope defined by a
Rectangle2D . 
Modifier and Type  Method and Description 

boolean 
reduceToDomain(boolean useDomainOfCRS)
Deprecated.
Restricts this envelope to the CS or CRS
domain of validity.

void 
roundIfAlmostInteger(double factor,
int maxULP)
Deprecated.
Fixes rounding errors up to a given tolerance level.

Rectangle2D 
toRectangle2D()
Deprecated.

add, add, castOrCopy, clone, intersect, normalize, setCoordinateReferenceSystem, setEnvelope, setEnvelope, setRange, setToInfinite, setToNaN, simplify, subEnvelope
contains, contains, contains, equals, getLowerCorner, getMedian, getSpan, getUpperCorner, intersects, intersects, toSimpleEnvelopes
public GeneralEnvelope(CoordinateReferenceSystem crs)
crs
 The coordinate reference system.public GeneralEnvelope(Envelope envelope)
envelope
 The envelope to copy.Envelope2D#Envelope2D(Envelope)
public GeneralEnvelope(GeographicBoundingBox box)
box
 The bounding box to copy.Envelope2D.Envelope2D(GeographicBoundingBox)
public GeneralEnvelope(Rectangle2D rect)
Rectangle2D
.
The coordinate reference system is initially undefined.rect
 The rectangle to copy.Envelope2D#Envelope2D(CoordinateReferenceSystem, Rectangle2D)
public GeneralEnvelope(GridEnvelope gridEnvelope, PixelInCell anchor, MathTransform gridToCRS, CoordinateReferenceSystem crs) throws IllegalArgumentException
anchor
value. This constructor creates an envelope
containing entirely all pixels on a best effort basis  usually
accurate for affine transforms.
Note: The convention is specified as a PixelInCell
code instead than
the more detailed PixelOrientation
, because the later is restricted to the
twodimensional case while the former can be used for any number of dimensions.
gridEnvelope
 The grid envelope in integer coordinates.anchor
 Whatever grid coordinates map to pixel center or pixel corner.gridToCRS
 The transform (usually affine) from grid envelope to the CRS.crs
 The CRS for the envelope to be created, or null
if unknown.MismatchedDimensionException
 If one of the supplied object doesn't have
a dimension compatible with the other objects.IllegalArgumentException
 if an argument is illegal for some other raisons,
including failure to use the provided math transform.GridToEnvelopeMapper
,
GeneralGridEnvelope.GeneralGridEnvelope(Envelope,PixelInCell,boolean)
public boolean reduceToDomain(boolean useDomainOfCRS)
First, ensure that the envelope is contained in the coordinate system domain. If some ordinates are out of range, then there is a choice depending on the range meaning:
If RangeMeaning.EXACT
(typically latitudes ordinates), then values
greater than the maximum value are
replaced by the maximum, and values smaller than the
minimum value are replaced by the minimum.
If RangeMeaning.WRAPAROUND
(typically longitudes ordinates),
then a multiple of the range (e.g. 360° for longitudes) is added or subtracted.
Example:
If crsDomain
is true
, then the envelope from the previous step
is intersected with the CRS domain of validity, if any.
Spanning the antimeridian of a Geographic CRS
Note that if the envelope is spanning the antimeridian, then some lower ordinate values may become greater than the upper ordinate
values even if it was not the case before this method call. If this is not acceptable, consider
invoking #reorderCorners()
after this method call.
Choosing the range of longitude values
Geographic CRS typically have longitude values in the [180 … +180]° range,
but the [0 … 360]° range is also occasionally used. Callers need to ensure
that this envelope CRS is associated to axes having the desired
minimum and
maximum value.
The AxisRangeType
enumeration can be used
for shifting a geographic CRS to the desired range.
Usage
This method is sometime useful before to compute the union
or intersection of envelopes, in order to ensure that
both envelopes are defined in the same domain. This method may also be invoked before
to project an envelope, since some projections produce Double.NaN
numbers when
given an ordinate value out of bounds.
useDomainOfCRS
 true
if the envelope should be restricted to
the CRS domain of validity in addition to the CS domain.true
if this envelope has been modified as a result of this method call,
or false
if no change was done.ReferenceSystem.getDomainOfValidity()
,
AxisRangeType
public void roundIfAlmostInteger(double factor, int maxULP)
ordinates[i]
at dimension i, this method multiplies the ordinate value by the given factor,
then round the result only if the product is close to an integer value. The threshold is
defined by the maxULP
argument in ULP units (Unit in the Last Place).
If and only if the product has been rounded, it is divided by the factor and stored in this
envelope in place of the original ordinate.
This method is useful after envelope calculations subject to rounding errors, like the
GeneralEnvelope(GridEnvelope, PixelInCell, MathTransform, CoordinateReferenceSystem)
constructor.
factor
 The factor by which to multiply ordinates before rounding
and divide after rounding. A recommended value is 360.maxULP
 The maximal change allowed in ULPs (Unit in the Last Place).public Rectangle2D toRectangle2D() throws IllegalStateException
Rectangle2D
with the minimum
and maximum values of this Envelope
.
This envelope must be twodimensional before this method is invoked.
Spanning the antimeridian of a Geographic CRS
If this envelope spans the antimeridian, then the longitude dimension will be
extended to full range of its coordinate system axis (typically [180 … 180]°).
IllegalStateException
 if this envelope is not twodimensional.Copyright © 2009–2014 Geotoolkit.org. All rights reserved.