org.geotools.pt
Class Envelope

java.lang.Object
  extended byorg.geotools.pt.Envelope
All Implemented Interfaces:
java.lang.Cloneable, org.opengis.util.Cloneable, Dimensioned, org.opengis.spatialschema.geometry.Envelope, java.io.Serializable

Deprecated. Replaced by GeneralEnvelope in the org.geotools.geometry package.

public class Envelope
extends java.lang.Object
implements org.opengis.spatialschema.geometry.Envelope, Dimensioned, org.opengis.util.Cloneable, java.io.Serializable

A box defined by two positions. The two positions must have the same dimension. Each of the ordinate values in the minimum point must be less than or equal to the corresponding ordinate value in the maximum point. Please note that these two points may be outside the valid domain of their coordinate system. (Of course the points and envelope do not explicitly reference a coordinate system, but their implicit coordinate system is defined by their context.)

Version:
1.00
Author:
OpenGIS (www.opengis.org), Martin Desruisseaux
See Also:
PT_Envelope, Rectangle2D, Serialized Form

Constructor Summary
Envelope(CoordinatePoint minCP, CoordinatePoint maxCP)
          Deprecated. Construct a envelope defined by two positions.
Envelope(double[] minCP, double[] maxCP)
          Deprecated. Construct a envelope defined by two positions.
Envelope(double min, double max)
          Deprecated. Construct one-dimensional envelope defined by a range of values.
Envelope(int dimension)
          Deprecated. Construct an empty envelope of the specified dimension.
Envelope(java.awt.geom.Rectangle2D rect)
          Deprecated. Construct two-dimensional envelope defined by a Rectangle2D.
 
Method Summary
 void add(CoordinatePoint point)
          Deprecated. Adds a point to this envelope.
 void add(Envelope envelope)
          Deprecated. Adds an envelope object to this envelope.
 java.lang.Object clone()
          Deprecated. Returns a deep copy of this envelope.
 boolean contains(CoordinatePoint point)
          Deprecated. Tests if a specified coordinate is inside the boundary of this envelope.
 Envelope createIntersection(Envelope envelope)
          Deprecated. Use ((Envelope)clone()).intersect(envelope) instead.
 boolean equals(java.lang.Object object)
          Deprecated. Compares the specified object with this envelope for equality.
static Envelope fromGeoAPI(org.opengis.spatialschema.geometry.Envelope envelope)
          Deprecated. Mimic a GeoAPI interface as a legacy implementation.
 double getCenter(int dimension)
          Deprecated. Returns the center ordinate along the specified dimension.
 org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
          Deprecated.  
 int getDimension()
          Deprecated. Returns the number of dimensions.
 double getLength(int dimension)
          Deprecated. Returns the envelope length along the specified dimension.
 org.opengis.spatialschema.geometry.DirectPosition getLowerCorner()
          Deprecated. 
 double getMaximum(int dimension)
          Deprecated. Returns the maximal ordinate along the specified dimension.
 double getMinimum(int dimension)
          Deprecated. Returns the minimal ordinate along the specified dimension.
 Envelope getReducedEnvelope(int lower, int upper)
          Deprecated. Returns a new envelope with the same values than this envelope minus the specified range of dimensions.
 Envelope getSubEnvelope(int lower, int upper)
          Deprecated. Returns a new envelope that encompass only some dimensions of this envelope.
 org.opengis.spatialschema.geometry.DirectPosition getUpperCorner()
          Deprecated. 
 int hashCode()
          Deprecated. Returns a hash value for this envelope.
 void intersect(Envelope envelope)
          Deprecated. Set this envelope to the intersection if this envelope with the specified one.
 boolean isEmpty()
          Deprecated. Determines whether or not this envelope is empty.
 void setRange(int dimension, double minimum, double maximum)
          Deprecated. Set the envelope's range along the specified dimension.
 java.awt.geom.Rectangle2D toRectangle2D()
          Deprecated. Returns a Rectangle2D with the same bounds as this Envelope.
 java.lang.String toString()
          Deprecated. Returns a string representation of this envelope.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Envelope

public Envelope(int dimension)
Deprecated. 
Construct an empty envelope of the specified dimension. All ordinates are initialized to 0.


Envelope

public Envelope(double min,
                double max)
Deprecated. 
Construct one-dimensional envelope defined by a range of values.

Parameters:
min - The minimal value.
max - The maximal value.

Envelope

public Envelope(double[] minCP,
                double[] maxCP)
         throws org.opengis.spatialschema.geometry.MismatchedDimensionException
Deprecated. 
Construct a envelope defined by two positions.

Parameters:
minCP - Minimum ordinate values.
maxCP - Maximum ordinate values.
Throws:
org.opengis.spatialschema.geometry.MismatchedDimensionException - if the two positions don't have the same dimension.
java.lang.IllegalArgumentException - if an ordinate value in the minimum point is not less than or equal to the corresponding ordinate value in the maximum point.

Envelope

public Envelope(CoordinatePoint minCP,
                CoordinatePoint maxCP)
         throws org.opengis.spatialschema.geometry.MismatchedDimensionException
Deprecated. 
Construct a envelope defined by two positions.

Parameters:
minCP - Point containing minimum ordinate values.
maxCP - Point containing maximum ordinate values.
Throws:
org.opengis.spatialschema.geometry.MismatchedDimensionException - if the two positions don't have the same dimension.
java.lang.IllegalArgumentException - if an ordinate value in the minimum point is not less than or equal to the corresponding ordinate value in the maximum point.

Envelope

public Envelope(java.awt.geom.Rectangle2D rect)
Deprecated. 
Construct two-dimensional envelope defined by a Rectangle2D.

Method Detail

isEmpty

public boolean isEmpty()
Deprecated. 
Determines whether or not this envelope is empty. An envelope is non-empty only if it has a length greater that 0 along all dimensions.


getDimension

public int getDimension()
Deprecated. 
Returns the number of dimensions.

Specified by:
getDimension in interface org.opengis.spatialschema.geometry.Envelope

getLowerCorner

public org.opengis.spatialschema.geometry.DirectPosition getLowerCorner()
Deprecated. 

Specified by:
getLowerCorner in interface org.opengis.spatialschema.geometry.Envelope

getUpperCorner

public org.opengis.spatialschema.geometry.DirectPosition getUpperCorner()
Deprecated. 

Specified by:
getUpperCorner in interface org.opengis.spatialschema.geometry.Envelope

getMinimum

public double getMinimum(int dimension)
Deprecated. 
Returns the minimal ordinate along the specified dimension.

Specified by:
getMinimum in interface org.opengis.spatialschema.geometry.Envelope

getMaximum

public double getMaximum(int dimension)
Deprecated. 
Returns the maximal ordinate along the specified dimension.

Specified by:
getMaximum in interface org.opengis.spatialschema.geometry.Envelope

getCenter

public double getCenter(int dimension)
Deprecated. 
Returns the center ordinate along the specified dimension.

Specified by:
getCenter in interface org.opengis.spatialschema.geometry.Envelope

getLength

public double getLength(int dimension)
Deprecated. 
Returns the envelope length along the specified dimension. This length is equals to the maximum ordinate minus the minimal ordinate.

Specified by:
getLength in interface org.opengis.spatialschema.geometry.Envelope

setRange

public void setRange(int dimension,
                     double minimum,
                     double maximum)
Deprecated. 
Set the envelope's range along the specified dimension.

Parameters:
dimension - The dimension to set.
minimum - The minimum value along the specified dimension.
maximum - The maximum value along the specified dimension.

add

public void add(CoordinatePoint point)
         throws org.opengis.spatialschema.geometry.MismatchedDimensionException
Deprecated. 
Adds a point to this envelope. The resulting envelope is the smallest envelope that contains both the original envelope and the specified point. After adding a point, a call to contains(org.geotools.pt.CoordinatePoint) with the added point as an argument will return true, except if one of the point's ordinates was Double.NaN (in which case the corresponding ordinate have been ignored).

Parameters:
point - The point to add.
Throws:
org.opengis.spatialschema.geometry.MismatchedDimensionException - if the specified point doesn't have the expected dimension.

add

public void add(Envelope envelope)
         throws org.opengis.spatialschema.geometry.MismatchedDimensionException
Deprecated. 
Adds an envelope object to this envelope. The resulting envelope is the union of the two Envelope objects.

Parameters:
envelope - the Envelope to add to this envelope.
Throws:
org.opengis.spatialschema.geometry.MismatchedDimensionException - if the specified envelope doesn't have the expected dimension.

contains

public boolean contains(CoordinatePoint point)
                 throws org.opengis.spatialschema.geometry.MismatchedDimensionException
Deprecated. 
Tests if a specified coordinate is inside the boundary of this envelope.

Parameters:
point - The point to text.
Returns:
true if the specified coordinates are inside the boundary of this envelope; false otherwise.
Throws:
org.opengis.spatialschema.geometry.MismatchedDimensionException - if the specified point doesn't have the expected dimension.

intersect

public void intersect(Envelope envelope)
               throws org.opengis.spatialschema.geometry.MismatchedDimensionException
Deprecated. 
Set this envelope to the intersection if this envelope with the specified one.

Parameters:
envelope - the Envelope to intersect to this envelope.
Throws:
org.opengis.spatialschema.geometry.MismatchedDimensionException - if the specified envelope doesn't have the expected dimension.

createIntersection

public Envelope createIntersection(Envelope envelope)
                            throws org.opengis.spatialschema.geometry.MismatchedDimensionException
Deprecated. Use ((Envelope)clone()).intersect(envelope) instead.

Returns a new envelope representing the intersection of this Envelope with the specified Envelope.

Parameters:
envelope - The Envelope to intersect with this envelope.
Returns:
The largest envelope contained in both the specified Envelope and in this Envelope.
Throws:
org.opengis.spatialschema.geometry.MismatchedDimensionException - if the specified envelope doesn't have the expected dimension.

getSubEnvelope

public Envelope getSubEnvelope(int lower,
                               int upper)
Deprecated. 
Returns a new envelope that encompass only some dimensions of this envelope. This method copy this envelope's ordinates into a new envelope, beginning at dimension lower and extending to dimension upper-1. Thus the dimension of the subenvelope is upper-lower.

Parameters:
lower - The first dimension to copy, inclusive.
upper - The last dimension to copy, exclusive.
Returns:
The subenvelope.
Throws:
java.lang.IndexOutOfBoundsException - if an index is out of bounds.

getReducedEnvelope

public Envelope getReducedEnvelope(int lower,
                                   int upper)
Deprecated. 
Returns a new envelope with the same values than this envelope minus the specified range of dimensions.

Parameters:
lower - The first dimension to omit, inclusive.
upper - The last dimension to omit, exclusive.
Returns:
The subenvelope.
Throws:
java.lang.IndexOutOfBoundsException - if an index is out of bounds.

toRectangle2D

public java.awt.geom.Rectangle2D toRectangle2D()
                                        throws java.lang.IllegalStateException
Deprecated. 
Returns a Rectangle2D with the same bounds as this Envelope. This is a convenience method for interoperability with Java2D.

Throws:
java.lang.IllegalStateException - if this envelope is not two-dimensional.

hashCode

public int hashCode()
Deprecated. 
Returns a hash value for this envelope. This value need not remain consistent between different implementations of the same class.


equals

public boolean equals(java.lang.Object object)
Deprecated. 
Compares the specified object with this envelope for equality.


clone

public java.lang.Object clone()
Deprecated. 
Returns a deep copy of this envelope.

Specified by:
clone in interface org.opengis.util.Cloneable

toString

public java.lang.String toString()
Deprecated. 
Returns a string representation of this envelope. The returned string is implementation dependent. It is usually provided for debugging purposes.


fromGeoAPI

public static Envelope fromGeoAPI(org.opengis.spatialschema.geometry.Envelope envelope)
Deprecated. 
Mimic a GeoAPI interface as a legacy implementation. This method is provided as a temporary bridge for using new CRS object with J2D-Renderer for example.


getCoordinateReferenceSystem

public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
Deprecated. 


Copyright © GeoTools. All Rights Reserved.