|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vividsolutions.jts.geom.Envelope
org.geotools.geometry.jts.ReferencedEnvelope
public class ReferencedEnvelope
A JTS envelope associated with a coordinate reference system. In addition, this JTS envelope also implements the GeoAPI envelope interface for interoperability with GeoAPI.
Envelope2D
,
GeneralEnvelope
,
GeographicBoundingBox
,
Serialized FormField Summary | |
---|---|
static ReferencedEnvelope |
EVERYTHING
A ReferencedEnvelope containing "everything" |
Constructor Summary | |
---|---|
ReferencedEnvelope()
Creates a null envelope with a null coordinate reference system. |
|
ReferencedEnvelope(org.opengis.geometry.BoundingBox bbox)
Creates a new envelope from an existing bounding box. |
|
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(org.opengis.geometry.Envelope envelope)
Creates a new envelope from an existing OGC envelope. |
|
ReferencedEnvelope(com.vividsolutions.jts.geom.Envelope envelope,
org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Creates a new envelope from an existing JTS envelope. |
|
ReferencedEnvelope(java.awt.geom.Rectangle2D rectangle,
org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Creates an envelope for a Java2D rectangle. |
|
ReferencedEnvelope(ReferencedEnvelope envelope)
Creates a new envelope from an existing envelope. |
Method Summary | |
---|---|
boolean |
boundsEquals2D(org.opengis.geometry.Envelope other,
double eps)
Compare the bounds of this envelope with those of another. |
boolean |
contains(org.opengis.geometry.BoundingBox bbox)
Returns true if the provided bounds are contained by this bounding box. |
boolean |
contains(org.opengis.geometry.DirectPosition pos)
Returns true if the provided location is contained by this bounding box. |
org.opengis.referencing.crs.CoordinateReferenceSystem |
crs()
Deprecated. Use getCoordinateReferenceSystem() , since it is the
method inherited from the interface. |
boolean |
equals(java.lang.Object object)
Compares the specified object with this envelope for equality. |
void |
expandToInclude(com.vividsolutions.jts.geom.Envelope other)
Include the provided envelope, expanding as necessary. |
double |
getCenter(int dimension)
Deprecated. Use getMedian(int) . |
org.opengis.referencing.crs.CoordinateReferenceSystem |
getCoordinateReferenceSystem()
Returns the coordinate reference system associated with this envelope. |
int |
getDimension()
Returns the number of dimensions. |
double |
getLength(int dimension)
Deprecated. Use getSpan(int) . |
org.opengis.geometry.DirectPosition |
getLowerCorner()
A coordinate position consisting of all the minimal ordinates for each dimension for all points within the Envelope . |
double |
getMaximum(int dimension)
Returns the maximal ordinate along the specified dimension. |
double |
getMedian(int dimension)
Returns the center ordinate along the specified dimension. |
double |
getMinimum(int dimension)
Returns the minimal ordinate along the specified dimension. |
double |
getSpan(int dimension)
Returns the envelope length along the specified dimension. |
org.opengis.geometry.DirectPosition |
getUpperCorner()
A coordinate position consisting of all the maximal ordinates for each dimension for all points within the Envelope . |
int |
hashCode()
Returns a hash value for this envelope. |
void |
include(org.opengis.geometry.BoundingBox bbox)
Include the provided bounding box, expanding as necessary. |
void |
include(double x,
double y)
Include the provided coordinates, expanding as necessary. |
void |
init(org.opengis.geometry.BoundingBox bounds)
Sets this envelope to the specified bounding box. |
com.vividsolutions.jts.geom.Envelope |
intersection(com.vividsolutions.jts.geom.Envelope env)
Check if this bounding box intersects the provided bounds. |
boolean |
intersects(org.opengis.geometry.BoundingBox bbox)
Check if this bounding box intersects the provided bounds. |
boolean |
isEmpty()
Returns true if lengths along all dimension are zero. |
double |
maxX()
Deprecated. Use Envelope.getMaxX() . |
double |
maxY()
Deprecated. Use Envelope.getMaxY() . |
double |
minX()
Deprecated. Use Envelope.getMinX() . |
double |
minY()
Deprecated. Use Envelope.getMinY() . |
static ReferencedEnvelope |
reference(org.opengis.geometry.BoundingBox e)
Utility method to ensure that an BoundingBox in a ReferencedEnvelope. |
static ReferencedEnvelope |
reference(com.vividsolutions.jts.geom.Envelope e)
Utility method to ensure that an Envelope if a ReferencedEnvelope. |
void |
setBounds(org.opengis.geometry.BoundingBox bbox)
Initialize the bounding box with another bounding box. |
org.opengis.geometry.BoundingBox |
toBounds(org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS)
Returns a new bounding box which contains the transformed shape of this bounding box. |
java.lang.String |
toString()
Returns a string representation of this envelope. |
ReferencedEnvelope |
transform(org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS,
boolean lenient)
Transforms the referenced envelope to the specified coordinate reference system. |
ReferencedEnvelope |
transform(org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS,
boolean lenient,
int numPointsForTransformation)
Transforms the referenced envelope to the specified coordinate reference system using the specified amount of points. |
Methods inherited from class com.vividsolutions.jts.geom.Envelope |
---|
centre, contains, contains, contains, covers, covers, covers, distance, expandBy, expandBy, expandToInclude, expandToInclude, getArea, getHeight, getMaxX, getMaxY, getMinX, getMinY, getWidth, init, init, init, init, init, intersects, intersects, intersects, intersects, intersects, isNull, overlaps, overlaps, overlaps, setToNull, translate |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.opengis.geometry.BoundingBox |
---|
contains, getHeight, getMaxX, getMaxY, getMinX, getMinY, getWidth |
Field Detail |
---|
public static ReferencedEnvelope EVERYTHING
Constructor Detail |
---|
public ReferencedEnvelope()
public ReferencedEnvelope(org.opengis.referencing.crs.CoordinateReferenceSystem crs) throws org.opengis.geometry.MismatchedDimensionException
crs
- The coordinate reference system.
org.opengis.geometry.MismatchedDimensionException
- if the CRS dimension is not valid.public ReferencedEnvelope(double x1, double x2, double y1, double y2, org.opengis.referencing.crs.CoordinateReferenceSystem crs) throws org.opengis.geometry.MismatchedDimensionException
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.
org.opengis.geometry.MismatchedDimensionException
- if the CRS dimension is not valid.public ReferencedEnvelope(java.awt.geom.Rectangle2D rectangle, org.opengis.referencing.crs.CoordinateReferenceSystem crs) throws org.opengis.geometry.MismatchedDimensionException
rectangle
- The rectangle.crs
- The coordinate reference system.
org.opengis.geometry.MismatchedDimensionException
- if the CRS dimension is not valid.public ReferencedEnvelope(ReferencedEnvelope envelope) throws org.opengis.geometry.MismatchedDimensionException
envelope
- The envelope to initialize from
org.opengis.geometry.MismatchedDimensionException
- if the CRS dimension is not valid.public ReferencedEnvelope(org.opengis.geometry.BoundingBox bbox) throws org.opengis.geometry.MismatchedDimensionException
bbox
- The bounding box to initialize from.
org.opengis.geometry.MismatchedDimensionException
- if the CRS dimension is not valid.public ReferencedEnvelope(org.opengis.geometry.Envelope envelope) throws org.opengis.geometry.MismatchedDimensionException
envelope
- The envelope to initialize from.
org.opengis.geometry.MismatchedDimensionException
- if the CRS dimension is not valid.public ReferencedEnvelope(com.vividsolutions.jts.geom.Envelope envelope, org.opengis.referencing.crs.CoordinateReferenceSystem crs) throws org.opengis.geometry.MismatchedDimensionException
envelope
- The envelope to initialize from.crs
- The coordinate reference system.
MismatchedDimensionExceptionif
- the CRS dimension is not valid.
org.opengis.geometry.MismatchedDimensionException
Method Detail |
---|
public void init(org.opengis.geometry.BoundingBox bounds)
public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
getCoordinateReferenceSystem
in interface org.opengis.geometry.Envelope
public org.opengis.referencing.crs.CoordinateReferenceSystem crs()
getCoordinateReferenceSystem()
, since it is the
method inherited from the interface.
public int getDimension()
getDimension
in interface org.opengis.geometry.Envelope
public double getMinimum(int dimension)
getMinimum
in interface org.opengis.geometry.Envelope
public double minX()
Envelope.getMinX()
.
public double minY()
Envelope.getMinY()
.
public double getMaximum(int dimension)
getMaximum
in interface org.opengis.geometry.Envelope
public double maxX()
Envelope.getMaxX()
.
public double maxY()
Envelope.getMaxY()
.
public double getCenter(int dimension)
getMedian(int)
.
getCenter
in interface org.opengis.geometry.Envelope
public double getMedian(int dimension)
getMedian
in interface org.opengis.geometry.Envelope
public double getLength(int dimension)
getSpan(int)
.
getLength
in interface org.opengis.geometry.Envelope
public double getSpan(int dimension)
getSpan
in interface org.opengis.geometry.Envelope
public org.opengis.geometry.DirectPosition getLowerCorner()
Envelope
.
getLowerCorner
in interface org.opengis.geometry.Envelope
public org.opengis.geometry.DirectPosition getUpperCorner()
Envelope
.
getUpperCorner
in interface org.opengis.geometry.Envelope
public boolean isEmpty()
true
if lengths along all dimension are zero.
isEmpty
in interface org.opengis.geometry.BoundingBox
public boolean contains(org.opengis.geometry.DirectPosition pos)
true
if the provided location is contained by this bounding box.
contains
in interface org.opengis.geometry.BoundingBox
public boolean contains(org.opengis.geometry.BoundingBox bbox)
true
if the provided bounds are contained by this bounding box.
contains
in interface org.opengis.geometry.BoundingBox
public boolean intersects(org.opengis.geometry.BoundingBox bbox)
intersects
in interface org.opengis.geometry.BoundingBox
public com.vividsolutions.jts.geom.Envelope intersection(com.vividsolutions.jts.geom.Envelope env)
intersection
in class com.vividsolutions.jts.geom.Envelope
public void include(org.opengis.geometry.BoundingBox bbox)
include
in interface org.opengis.geometry.BoundingBox
public void expandToInclude(com.vividsolutions.jts.geom.Envelope other)
expandToInclude
in class com.vividsolutions.jts.geom.Envelope
public void include(double x, double y)
include
in interface org.opengis.geometry.BoundingBox
public void setBounds(org.opengis.geometry.BoundingBox bbox)
setBounds
in interface org.opengis.geometry.BoundingBox
public org.opengis.geometry.BoundingBox toBounds(org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS) throws org.opengis.referencing.operation.TransformException
transform
method.
toBounds
in interface org.opengis.geometry.BoundingBox
org.opengis.referencing.operation.TransformException
public ReferencedEnvelope transform(org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS, boolean lenient) throws org.opengis.referencing.operation.TransformException, org.opengis.referencing.FactoryException
This method can handle the case where the envelope contains the North or South pole, or when it cross the ±180� longitude.
targetCRS
- The target coordinate reference system.lenient
- true
if datum shift should be applied even if there is
insuffisient information. Otherwise (if false
), an
exception is thrown in such case.
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.CRS.transform(CoordinateOperation, org.opengis.geometry.Envelope)
public ReferencedEnvelope transform(org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS, boolean lenient, int numPointsForTransformation) throws org.opengis.referencing.operation.TransformException, org.opengis.referencing.FactoryException
This method can handle the case where the envelope contains the North or South pole, or when it cross the ±180� longitude.
targetCRS
- The target coordinate reference system.lenient
- true
if datum shift should be applied even if there is
insuffisient information. Otherwise (if false
), an
exception is thrown in such case.numPointsForTransformation
- The number of points to use for sampling the envelope.
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.CRS.transform(CoordinateOperation, org.opengis.geometry.Envelope)
public int hashCode()
hashCode
in class com.vividsolutions.jts.geom.Envelope
public boolean equals(java.lang.Object object)
equals
in class com.vividsolutions.jts.geom.Envelope
public boolean boundsEquals2D(org.opengis.geometry.Envelope other, double eps)
Note: in this test:
other
- other envelopeeps
- a small tolerance factor (e.g. 1.0e-6d) which will be scaled
relative to this envlope's width and height
public java.lang.String toString()
toString
in class com.vividsolutions.jts.geom.Envelope
public static ReferencedEnvelope reference(com.vividsolutions.jts.geom.Envelope e)
This method first checks if e is an instanceof ReferencedEnvelope
,
if it is, itself is returned. If not new ReferencedEnvelpe(e,null)
is returned.
If e is null, null is returned.
e
- The envelope. Can be null.
public static ReferencedEnvelope reference(org.opengis.geometry.BoundingBox e)
This method first checks if e is an instanceof ReferencedEnvelope
,
if it is, itself is returned. If not new ReferencedEnvelpe(e)
is returned.
e
- The envelope.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |