org.geotools.geometry.jts
Class ReferencedEnvelope

java.lang.Object
  extended bycom.vividsolutions.jts.geom.Envelope
      extended byorg.geotools.geometry.jts.ReferencedEnvelope
All Implemented Interfaces:
org.opengis.spatialschema.geometry.Envelope, java.io.Serializable

public class ReferencedEnvelope
extends com.vividsolutions.jts.geom.Envelope
implements org.opengis.spatialschema.geometry.Envelope

A JTS envelope associated with a coordinate reference system. In addition, this JTS envelope also implements the GeoAPI envelope interface for interoperability with GeoAPI.

Since:
2.2
Version:
$Id: ReferencedEnvelope.java 17707 2006-01-23 03:45:14Z desruisseaux $
Author:
Jody Garnett, Martin Desruisseaux
See Also:
Envelope2D, GeneralEnvelope, GeographicBoundingBox, Serialized Form

Constructor Summary
ReferencedEnvelope(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
          Creates a null envelope with the specified coordinate reference system.
ReferencedEnvelope(double x1, double x2, double y1, double y2, org.opengis.referencing.crs.CoordinateReferenceSystem crs)
          Creates an envelope for a region defined by maximum and minimum values.
ReferencedEnvelope(com.vividsolutions.jts.geom.Envelope envelope, org.opengis.referencing.crs.CoordinateReferenceSystem crs)
          Creates a new envelope from an existing envelope.
 
Method Summary
 boolean equals(java.lang.Object object)
          Compares the specified object with this envelope for equality.
 double getCenter(int dimension)
          Returns the center ordinate along the specified dimension.
 org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
          Returns the coordinate reference system associated with this envelope.
 org.opengis.referencing.crs.CoordinateReferenceSystem getCRS()
          Deprecated. Replaced by getCoordinateReferenceSystem() for consistency with other envelope implementations, and also because a future GeoAPI release may provides a method in their interface.
 int getDimension()
          Returns the number of dimensions.
 double getLength(int dimension)
          Returns the envelope length along the specified dimension.
 org.opengis.spatialschema.geometry.DirectPosition getLowerCorner()
          A coordinate position consisting of all the minimal ordinates for each dimension for all points within the .
 double getMaximum(int dimension)
          Returns the maximal ordinate along the specified dimension.
 double getMinimum(int dimension)
          Returns the minimal ordinate along the specified dimension.
 org.opengis.spatialschema.geometry.DirectPosition getUpperCorner()
          A coordinate position consisting of all the maximal ordinates for each dimension for all points within the .
 int hashCode()
          Returns a hash value for this envelope.
 ReferencedEnvelope transform(org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS, boolean lenient)
          Transforms the referenced envelope to the specified coordinate reference system.
 
Methods inherited from class com.vividsolutions.jts.geom.Envelope
contains, contains, contains, distance, expandToInclude, expandToInclude, expandToInclude, getHeight, getMaxX, getMaxY, getMinX, getMinY, getWidth, init, init, init, init, init, intersects, intersects, intersects, intersects, intersects, isNull, overlaps, overlaps, overlaps, setToNull, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReferencedEnvelope

public ReferencedEnvelope(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Creates a null envelope with the specified coordinate reference system.

Parameters:
crs - The coordinate reference system.
Throws:
java.lang.IllegalArgumentException - if the CRS dimension is not valid.

ReferencedEnvelope

public ReferencedEnvelope(double x1,
                          double x2,
                          double y1,
                          double y2,
                          org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Creates an envelope for a region defined by maximum and minimum values.

Parameters:
x1 - the first x-value.
x2 - the second x-value.
y1 - the first y-value.
y2 - the second y-value.
crs - The coordinate reference system.
Throws:
java.lang.IllegalArgumentException - if the CRS dimension is not valid.

ReferencedEnvelope

public ReferencedEnvelope(com.vividsolutions.jts.geom.Envelope envelope,
                          org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Creates a new envelope from an existing envelope.

Parameters:
envelope - The Envelope to initialize from
crs - The coordinate reference system.
Throws:
java.lang.IllegalArgumentException - if the CRS dimension is not valid.
Method Detail

getCRS

public org.opengis.referencing.crs.CoordinateReferenceSystem getCRS()
Deprecated. Replaced by getCoordinateReferenceSystem() for consistency with other envelope implementations, and also because a future GeoAPI release may provides a method in their interface.

Returns the coordinate reference system associated with this envelope.


getCoordinateReferenceSystem

public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
Returns the coordinate reference system associated with this envelope.


getDimension

public int getDimension()
Returns the number of dimensions.

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

getMinimum

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

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

getMaximum

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

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

getCenter

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

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

getLength

public double getLength(int dimension)
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

getLowerCorner

public org.opengis.spatialschema.geometry.DirectPosition getLowerCorner()
A coordinate position consisting of all the minimal ordinates for each dimension for all points within the .

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

getUpperCorner

public org.opengis.spatialschema.geometry.DirectPosition getUpperCorner()
A coordinate position consisting of all the maximal ordinates for each dimension for all points within the .

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

transform

public ReferencedEnvelope transform(org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS,
                                    boolean lenient)
                             throws org.opengis.referencing.operation.TransformException,
                                    org.opengis.referencing.FactoryException
Transforms the referenced envelope to the specified coordinate reference system.

Parameters:
targetCRS - The target coordinate reference system.
lenient - if datum shift should be applied even if there is insuffisient information. Otherwise (if ), an exception is thrown in such case.
Returns:
The transformed envelope.
Throws:
org.opengis.referencing.FactoryException - if the math transform can't be determined.
org.opengis.referencing.operation.TransformException - if at least one coordinate can't be transformed.

hashCode

public int hashCode()
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)
Compares the specified object with this envelope for equality.



Copyright © GeoTools. All Rights Reserved.