org.geotools.geometry.iso.coordinate
Class EnvelopeImpl

java.lang.Object
  extended by org.geotools.geometry.iso.coordinate.EnvelopeImpl
All Implemented Interfaces:
java.io.Serializable, org.opengis.geometry.Envelope

public class EnvelopeImpl
extends java.lang.Object
implements org.opengis.geometry.Envelope, java.io.Serializable

An envlope represents the bounding box of a geometric object. Regardless to the dimension, the envelope can be encoded by two DirectPositions.

See Also:
Serialized Form

Constructor Summary
EnvelopeImpl(org.opengis.geometry.DirectPosition position)
           
EnvelopeImpl(org.opengis.geometry.DirectPosition p0, org.opengis.geometry.DirectPosition p1)
          Constructor
EnvelopeImpl(org.opengis.geometry.Envelope env)
          Constructor
EnvelopeImpl(org.opengis.geometry.coordinate.Position position)
           
 
Method Summary
 void add(org.opengis.geometry.DirectPosition p)
           
 void add(double[] coord)
           
 void add(EnvelopeImpl env)
           
 boolean contains(org.opengis.geometry.DirectPosition p)
          Verifies whether a DirectPosition2D lays within the envelope or at its border Test OK
static EnvelopeImpl createEnvelope(org.opengis.geometry.DirectPosition[] p)
           
 boolean equals(org.opengis.geometry.Envelope env)
          Compares coordinates between the envelope and another envelope Test OK
 void expand(double[] coord)
          Expands the envelope with a direct Position
 void expand(org.opengis.geometry.Envelope env)
          Unions an envelope with an another envelope
 double getCenter(int dimension)
           
 org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
           
 int getDimension()
           
 double getLength(int dimension)
           
 org.opengis.geometry.DirectPosition getLowerCorner()
           
 double getMaximum(int dimension)
           
 double getMedian(int dimension)
           
 double getMinimum(int dimension)
           
 org.opengis.geometry.DirectPosition getNECorner()
          The North East corner of this Envelope
 DirectPositionImpl getNWCorner()
           
 DirectPositionImpl getNWCornerOld()
          The North West corner of this Envelope 2D and 2.5D only! In 2.5D, the z value will be set equal to the z value of the lower corner z value.
 org.opengis.geometry.DirectPosition getSECorner()
          The South East corner of this Envelope 2D and 2.5D only! In 2.5D, the z value will be set equal to the z value of the lower corner z value.
 double getSpan(int dimension)
           
 org.opengis.geometry.DirectPosition getSWCorner()
          The South West corner of this Envelope
 org.opengis.geometry.DirectPosition getUpperCorner()
           
 boolean intersects(org.opengis.geometry.DirectPosition dp)
          Verifies wheater the coordinate of a Direct Position intersects with the envelope
 boolean intersects(org.opengis.geometry.Envelope other)
          Verifies whether another envelope intersects with this envelope
 void setValues(org.opengis.geometry.DirectPosition p0, org.opengis.geometry.DirectPosition p1)
           
 void setValues(EnvelopeImpl env)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EnvelopeImpl

public EnvelopeImpl(org.opengis.geometry.Envelope env)
Constructor

Parameters:
env -

EnvelopeImpl

public EnvelopeImpl(org.opengis.geometry.DirectPosition p0,
                    org.opengis.geometry.DirectPosition p1)
Constructor

Parameters:
p0 -
p1 -

EnvelopeImpl

public EnvelopeImpl(org.opengis.geometry.coordinate.Position position)
Parameters:
p0 -

EnvelopeImpl

public EnvelopeImpl(org.opengis.geometry.DirectPosition position)
Parameters:
p0 -
Method Detail

getDimension

public int getDimension()
Specified by:
getDimension in interface org.opengis.geometry.Envelope

getCoordinateReferenceSystem

public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
Specified by:
getCoordinateReferenceSystem in interface org.opengis.geometry.Envelope

getMinimum

public double getMinimum(int dimension)
Specified by:
getMinimum in interface org.opengis.geometry.Envelope

getMaximum

public double getMaximum(int dimension)
Specified by:
getMaximum in interface org.opengis.geometry.Envelope

getCenter

public double getCenter(int dimension)
Specified by:
getCenter in interface org.opengis.geometry.Envelope

getMedian

public double getMedian(int dimension)
Specified by:
getMedian in interface org.opengis.geometry.Envelope

getLength

public double getLength(int dimension)
Specified by:
getLength in interface org.opengis.geometry.Envelope

getSpan

public double getSpan(int dimension)
Specified by:
getSpan in interface org.opengis.geometry.Envelope

getUpperCorner

public org.opengis.geometry.DirectPosition getUpperCorner()
Specified by:
getUpperCorner in interface org.opengis.geometry.Envelope

getLowerCorner

public org.opengis.geometry.DirectPosition getLowerCorner()
Specified by:
getLowerCorner in interface org.opengis.geometry.Envelope

setValues

public void setValues(org.opengis.geometry.DirectPosition p0,
                      org.opengis.geometry.DirectPosition p1)
Parameters:
p0 -
p1 -

setValues

public void setValues(EnvelopeImpl env)
Parameters:
env -

createEnvelope

public static EnvelopeImpl createEnvelope(org.opengis.geometry.DirectPosition[] p)
Parameters:
p -
Returns:
EnvelopeImpl

expand

public void expand(org.opengis.geometry.Envelope env)
Unions an envelope with an another envelope

Parameters:
env -

expand

public void expand(double[] coord)
Expands the envelope with a direct Position

Parameters:
coord -

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

add

public void add(double[] coord)
Parameters:
coord -

add

public void add(org.opengis.geometry.DirectPosition p)
Parameters:
p -

add

public void add(EnvelopeImpl env)
Parameters:
env -

equals

public boolean equals(org.opengis.geometry.Envelope env)
Compares coordinates between the envelope and another envelope Test OK

Parameters:
env -
Returns:
boolean

intersects

public boolean intersects(org.opengis.geometry.Envelope other)
Verifies whether another envelope intersects with this envelope

Parameters:
other -
Returns:
TRUE, if envelopes intersect; FALSE, if they dont intersect

intersects

public boolean intersects(org.opengis.geometry.DirectPosition dp)
Verifies wheater the coordinate of a Direct Position intersects with the envelope

Parameters:
dp -
Returns:
boolean

getNECorner

public org.opengis.geometry.DirectPosition getNECorner()
The North East corner of this Envelope

Returns:

getSWCorner

public org.opengis.geometry.DirectPosition getSWCorner()
The South West corner of this Envelope

Returns:

getSECorner

public org.opengis.geometry.DirectPosition getSECorner()
                                                throws UnsupportedDimensionException
The South East corner of this Envelope 2D and 2.5D only! In 2.5D, the z value will be set equal to the z value of the lower corner z value.

Returns:
Throws:
UnsupportedDimensionException

getNWCornerOld

public DirectPositionImpl getNWCornerOld()
                                  throws UnsupportedDimensionException
The North West corner of this Envelope 2D and 2.5D only! In 2.5D, the z value will be set equal to the z value of the lower corner z value.

Returns:
Throws:
UnsupportedDimensionException

getNWCorner

public DirectPositionImpl getNWCorner()
                               throws UnsupportedDimensionException
Throws:
UnsupportedDimensionException

contains

public boolean contains(org.opengis.geometry.DirectPosition p)
Verifies whether a DirectPosition2D lays within the envelope or at its border Test OK

Parameters:
p -
Returns:
TRUE, if the DirectPosition2D lays within the envelope


Copyright © 1996-2010 Geotools. All Rights Reserved.