| org.geotools.geometry.jts.ReferencedEnvelope
ReferencedEnvelope | public class ReferencedEnvelope extends Envelope implements org.opengis.geometry.Envelope,BoundingBox(Code) | | A JTS envelope associated with a
. In
addition, this JTS envelope also implements the GeoAPI
interface
for interoperability with GeoAPI.
since: 2.2 version: $Id: ReferencedEnvelope.java 26186 2007-07-10 02:18:59Z jdeolive $ author: Jody Garnett author: Martin Desruisseaux author: Simone Giannecchini See Also: org.geotools.geometry.Envelope2D See Also: org.geotools.geometry.GeneralEnvelope See Also: org.opengis.metadata.extent.GeographicBoundingBox |
Constructor Summary | |
public | ReferencedEnvelope(CoordinateReferenceSystem crs) Creates a null envelope with the specified coordinate reference system. | public | ReferencedEnvelope(double x1, double x2, double y1, double y2, CoordinateReferenceSystem crs) Creates an envelope for a region defined by maximum and minimum values. | public | ReferencedEnvelope(Rectangle2D rectangle, CoordinateReferenceSystem crs) Creates an envelope for a Java2D rectangle. | public | ReferencedEnvelope(ReferencedEnvelope envelope) Creates a new envelope from an existing envelope. | public | ReferencedEnvelope(BoundingBox bbox) Creates a new envelope from an existing bounding box. | public | ReferencedEnvelope(org.opengis.geometry.Envelope envelope) Creates a new envelope from an existing OGC envelope. | public | ReferencedEnvelope(Envelope envelope, CoordinateReferenceSystem crs) Creates a new envelope from an existing JTS envelope. |
Method Summary | |
public boolean | contains(DirectPosition pos) Returns
true if the provided location is contained by this bounding box. | public boolean | contains(BoundingBox bbox) Returns
true if the provided bounds are contained by this bounding box. | public boolean | equals(Object object) Compares the specified object with this envelope for equality. | public double | getCenter(int dimension) Returns the center ordinate along the specified dimension. | public CoordinateReferenceSystem | getCoordinateReferenceSystem() Returns the coordinate reference system associated with this envelope. | public int | getDimension() Returns the number of dimensions. | public double | getLength(int dimension) Returns the envelope length along the specified dimension. | public DirectPosition | getLowerCorner() A coordinate position consisting of all the minimal ordinates for each
dimension for all points within the
Envelope . | public double | getMaximum(int dimension) Returns the maximal ordinate along the specified dimension. | public double | getMinimum(int dimension) Returns the minimal ordinate along the specified dimension. | public DirectPosition | getUpperCorner() A coordinate position consisting of all the maximal ordinates for each
dimension for all points within the
Envelope . | public int | hashCode() Returns a hash value for this envelope. | public void | include(BoundingBox bbox) Include the provided bounding box, expanding as necessary. | public void | include(double x, double y) Include the provided coordinates, expanding as necessary. | public boolean | intersects(BoundingBox bbox) Check if this bounding box intersects the provided bounds. | public boolean | isEmpty() Returns
true if lengths along all dimension are zero. | public static ReferencedEnvelope | reference(Envelope e) Utility method to ensure that an Envelope if a ReferencedEnvelope.
This method first checks if e is an instanceof
ReferencedEnvelope ,
if it is, itself is returned. | public void | setBounds(BoundingBox bbox) Initialize the bounding box with another bounding box. | public BoundingBox | toBounds(CoordinateReferenceSystem targetCRS) Returns a new bounding box which contains the transformed shape of this bounding box. | public String | toString() Returns a string representation of this envelope. | public ReferencedEnvelope | transform(CoordinateReferenceSystem targetCRS, boolean lenient) Transforms the referenced envelope to the specified coordinate reference system.
This method can handle the case where the envelope contains the North or South pole,
or when it cross the ±180� longitude.
Parameters: targetCRS - The target coordinate reference system. Parameters: lenient - true if datum shift should be applied even if there isinsuffisient information. | public ReferencedEnvelope | transform(CoordinateReferenceSystem targetCRS, boolean lenient, int numPointsForTransformation) Transforms the referenced envelope to the specified coordinate reference system
using the specified amount of points.
This method can handle the case where the envelope contains the North or South pole,
or when it cross the ±180� longitude.
Parameters: targetCRS - The target coordinate reference system. Parameters: lenient - true if datum shift should be applied even if there isinsuffisient information. |
ReferencedEnvelope | public ReferencedEnvelope(CoordinateReferenceSystem crs) throws MismatchedDimensionException(Code) | | Creates a null envelope with the specified coordinate reference system.
Parameters: crs - The coordinate reference system. throws: MismatchedDimensionException - if the CRS dimension is not valid. |
ReferencedEnvelope | public ReferencedEnvelope(double x1, double x2, double y1, double y2, CoordinateReferenceSystem crs) throws MismatchedDimensionException(Code) | | Creates an envelope for a region defined by maximum and minimum values.
Parameters: x1 - The first x-value. Parameters: x2 - The second x-value. Parameters: y1 - The first y-value. Parameters: y2 - The second y-value. Parameters: crs - The coordinate reference system. throws: MismatchedDimensionException - if the CRS dimension is not valid. |
ReferencedEnvelope | public ReferencedEnvelope(Rectangle2D rectangle, CoordinateReferenceSystem crs) throws MismatchedDimensionException(Code) | | Creates an envelope for a Java2D rectangle.
Parameters: rectangle - The rectangle. Parameters: crs - The coordinate reference system. throws: MismatchedDimensionException - if the CRS dimension is not valid. since: 2.4 |
ReferencedEnvelope | public ReferencedEnvelope(ReferencedEnvelope envelope) throws MismatchedDimensionException(Code) | | Creates a new envelope from an existing envelope.
Parameters: envelope - The envelope to initialize from throws: MismatchedDimensionException - if the CRS dimension is not valid. since: 2.3 |
ReferencedEnvelope | public ReferencedEnvelope(BoundingBox bbox) throws MismatchedDimensionException(Code) | | Creates a new envelope from an existing bounding box.
Parameters: bbox - The bounding box to initialize from. throws: MismatchedDimensionException - if the CRS dimension is not valid. since: 2.4 |
ReferencedEnvelope | public ReferencedEnvelope(org.opengis.geometry.Envelope envelope) throws MismatchedDimensionException(Code) | | Creates a new envelope from an existing OGC envelope.
Parameters: envelope - The envelope to initialize from. throws: MismatchedDimensionException - if the CRS dimension is not valid. since: 2.4 |
ReferencedEnvelope | public ReferencedEnvelope(Envelope envelope, CoordinateReferenceSystem crs) throws MismatchedDimensionException(Code) | | Creates a new envelope from an existing JTS envelope.
Parameters: envelope - The envelope to initialize from. Parameters: crs - The coordinate reference system. throws: MismatchedDimensionExceptionif - the CRS dimension is not valid. |
contains | public boolean contains(DirectPosition pos)(Code) | | Returns
true if the provided location is contained by this bounding box.
since: 2.4 |
contains | public boolean contains(BoundingBox bbox)(Code) | | Returns
true if the provided bounds are contained by this bounding box.
since: 2.4 |
equals | public boolean equals(Object object)(Code) | | Compares the specified object with this envelope for equality.
|
getCenter | public double getCenter(int dimension)(Code) | | Returns the center ordinate along the specified dimension.
|
getCoordinateReferenceSystem | public CoordinateReferenceSystem getCoordinateReferenceSystem()(Code) | | Returns the coordinate reference system associated with this envelope.
|
getDimension | public int getDimension()(Code) | | Returns the number of dimensions.
|
getLength | public double getLength(int dimension)(Code) | | Returns the envelope length along the specified dimension. This length is
equals to the maximum ordinate minus the minimal ordinate.
|
getLowerCorner | public DirectPosition getLowerCorner()(Code) | | A coordinate position consisting of all the minimal ordinates for each
dimension for all points within the
Envelope .
|
getMaximum | public double getMaximum(int dimension)(Code) | | Returns the maximal ordinate along the specified dimension.
|
getMinimum | public double getMinimum(int dimension)(Code) | | Returns the minimal ordinate along the specified dimension.
|
getUpperCorner | public DirectPosition getUpperCorner()(Code) | | A coordinate position consisting of all the maximal ordinates for each
dimension for all points within the
Envelope .
|
hashCode | public int hashCode()(Code) | | Returns a hash value for this envelope. This value need not remain
consistent between different implementations of the same class.
|
include | public void include(BoundingBox bbox)(Code) | | Include the provided bounding box, expanding as necessary.
since: 2.4 |
include | public void include(double x, double y)(Code) | | Include the provided coordinates, expanding as necessary.
since: 2.4 |
intersects | public boolean intersects(BoundingBox bbox)(Code) | | Check if this bounding box intersects the provided bounds.
since: 2.4 |
isEmpty | public boolean isEmpty()(Code) | | Returns
true if lengths along all dimension are zero.
since: 2.4 |
reference | public static ReferencedEnvelope reference(Envelope e)(Code) | | Utility method to ensure that an Envelope if a ReferencedEnvelope.
This method first checks if e is an instanceof
ReferencedEnvelope ,
if it is, itself is returned. If not new ReferencedEnvelpe(e,null)
is returned.
Parameters: e - The envelope. |
setBounds | public void setBounds(BoundingBox bbox)(Code) | | Initialize the bounding box with another bounding box.
since: 2.4 |
toBounds | public BoundingBox toBounds(CoordinateReferenceSystem targetCRS) throws TransformException(Code) | | Returns a new bounding box which contains the transformed shape of this bounding box.
This is a convenience method that delegate its work to the
ReferencedEnvelope.transform transform method.
since: 2.4 |
toString | public String toString()(Code) | | Returns a string representation of this envelope. The default implementation
is okay for occasional formatting (for example for debugging purpose).
|
transform | public ReferencedEnvelope transform(CoordinateReferenceSystem targetCRS, boolean lenient) throws TransformException, FactoryException(Code) | | Transforms the referenced envelope to the specified coordinate reference system.
This method can handle the case where the envelope contains the North or South pole,
or when it cross the ±180� longitude.
Parameters: targetCRS - The target coordinate reference system. Parameters: lenient - true if datum shift should be applied even if there isinsuffisient information. Otherwise (if false ), anexception is thrown in such case. The transformed envelope. throws: FactoryException - if the math transform can't be determined. throws: TransformException - if at least one coordinate can't be transformed. See Also: CRS.transform(CoordinateOperationorg.opengis.geometry.Envelope) |
transform | public ReferencedEnvelope transform(CoordinateReferenceSystem targetCRS, boolean lenient, int numPointsForTransformation) throws TransformException, FactoryException(Code) | | Transforms the referenced envelope to the specified coordinate reference system
using the specified amount of points.
This method can handle the case where the envelope contains the North or South pole,
or when it cross the ±180� longitude.
Parameters: targetCRS - The target coordinate reference system. Parameters: lenient - true if datum shift should be applied even if there isinsuffisient information. Otherwise (if false ), anexception is thrown in such case. Parameters: numPointsForTransformation - The number of points to use for sampling the envelope. The transformed envelope. throws: FactoryException - if the math transform can't be determined. throws: TransformException - if at least one coordinate can't be transformed. See Also: CRS.transform(CoordinateOperationorg.opengis.geometry.Envelope) since: 2.3 |
|
|