deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.model.spatialschema
Class EnvelopeImpl

java.lang.Object
  extended by org.deegree.model.spatialschema.EnvelopeImpl
All Implemented Interfaces:
java.io.Serializable, Envelope
Direct Known Subclasses:
LayerBoundingBox

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

a boundingbox as child of a Polygon isn't part of the iso19107 spec but it simplifies the geometry handling

------------------------------------------------------------

Version:
$Id: EnvelopeImpl.java 18195 2009-06-18 15:55:39Z mschneider $
Author:
Andreas Poth href="mailto:poth@lat-lon.de", Markus Bedel href="mailto:bedel@giub.uni-bonn.de"
See Also:
Serialized Form

Field Summary
protected  CoordinateSystem crs
           
protected  Position max
           
protected  Position min
           
 
Constructor Summary
protected EnvelopeImpl()
          Creates a new EnvelopeImpl object.
protected EnvelopeImpl(Position min, Position max)
          Creates a new EnvelopeImpl object.
protected EnvelopeImpl(Position min, Position max, CoordinateSystem crs)
          Creates a new EnvelopeImpl object.
 
Method Summary
 java.lang.Object clone()
           
 boolean contains(Envelope bb)
          returns true if all points of the submitted bounding box are within this bounding box
 boolean contains(Position point)
          returns true if the bounding box conatins the specified Point
 Envelope createIntersection(Envelope bb)
          returns a new Envelope object representing the intersection of this Envelope with the specified Envelope. * Note: If there is no intersection at all Envelope will be null.
 boolean equals(java.lang.Object other)
          checks if this point is completly equal to the submitted geometry
 void expandToContain(Envelope other)
          ensures that the passed Envepole is contained within this.Envelope
 Envelope getBuffer(double b)
          creates a new envelope
 Point getCentroid()
          returns the centroid of an Envelope
 CoordinateSystem getCoordinateSystem()
          returns the spatial reference system of a geometry
 double getHeight()
          returns the height of bounding box
 Position getMax()
          returns the maximum coordinates of bounding box
 Position getMin()
          returns the minimum coordinates of bounding box
 double getWidth()
          returns the width of bounding box
 boolean intersects(Envelope bb)
          returns true if this envelope and the submitted intersects
 Envelope merge(Envelope envelope)
          merges two Envelops and returns the minimum envelope containing both.
 java.lang.String toString()
           
 Envelope translate(double x, double y)
          translate a envelope in the direction defined by the two passed values and retiurns the resulting envelope
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

max

protected Position max

min

protected Position min

crs

protected CoordinateSystem crs
Constructor Detail

EnvelopeImpl

protected EnvelopeImpl()
Creates a new EnvelopeImpl object.


EnvelopeImpl

protected EnvelopeImpl(Position min,
                       Position max)
Creates a new EnvelopeImpl object.

Parameters:
min -
max -

EnvelopeImpl

protected EnvelopeImpl(Position min,
                       Position max,
                       CoordinateSystem crs)
Creates a new EnvelopeImpl object.

Parameters:
min -
max -
crs -
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object
Returns:
a shallow copy of this Envelope

getCoordinateSystem

public CoordinateSystem getCoordinateSystem()
returns the spatial reference system of a geometry

Specified by:
getCoordinateSystem in interface Envelope
Returns:
the spatial reference system of a geometry

getMin

public Position getMin()
returns the minimum coordinates of bounding box

Specified by:
getMin in interface Envelope
Returns:
the minimum coordinates of bounding box

getMax

public Position getMax()
returns the maximum coordinates of bounding box

Specified by:
getMax in interface Envelope
Returns:
the maximum coordinates of bounding box

getWidth

public double getWidth()
returns the width of bounding box

Specified by:
getWidth in interface Envelope
Returns:
the width of bounding box

getHeight

public double getHeight()
returns the height of bounding box

Specified by:
getHeight in interface Envelope
Returns:
the height of bounding box

contains

public boolean contains(Position point)
returns true if the bounding box conatins the specified Point

Specified by:
contains in interface Envelope
Parameters:
point - the position to find
Returns:
true if the bounding box contains the submitted position

intersects

public boolean intersects(Envelope bb)
returns true if this envelope and the submitted intersects

Specified by:
intersects in interface Envelope
Parameters:
bb - another Envelope
Returns:
true if this envelope intersects the submitted envelope

contains

public boolean contains(Envelope bb)
returns true if all points of the submitted bounding box are within this bounding box

Specified by:
contains in interface Envelope
Parameters:
bb - another boundingbox
Returns:
true if all positions of the submitted bounding box are within this bounding box

createIntersection

public Envelope createIntersection(Envelope bb)
returns a new Envelope object representing the intersection of this Envelope with the specified Envelope. * Note: If there is no intersection at all Envelope will be null.

Specified by:
createIntersection in interface Envelope
Parameters:
bb - the Envelope to be intersected with this Envelope
Returns:
the largest Envelope contained in both the specified Envelope and in this Envelope.

equals

public boolean equals(java.lang.Object other)
checks if this point is completly equal to the submitted geometry

Overrides:
equals in class java.lang.Object

getBuffer

public Envelope getBuffer(double b)
Description copied from interface: Envelope
creates a new envelope

Specified by:
getBuffer in interface Envelope
Parameters:
b - an extra bound around the Envelope
Returns:
buffered box

merge

public Envelope merge(Envelope envelope)
               throws GeometryException
Description copied from interface: Envelope
merges two Envelops and returns the minimum envelope containing both.

Specified by:
merge in interface Envelope
Parameters:
envelope - another envelope to merge with this one
Returns:
the minimum envelope containing both.
Throws:
GeometryException - if the coordinatesystems are not equal
See Also:
Envelope.merge(org.deegree.model.spatialschema.Envelope)

expandToContain

public void expandToContain(Envelope other)
ensures that the passed Envepole is contained within this.Envelope

Specified by:
expandToContain in interface Envelope
Parameters:
other -

translate

public Envelope translate(double x,
                          double y)
translate a envelope in the direction defined by the two passed values and retiurns the resulting envelope

Specified by:
translate in interface Envelope
Parameters:
x -
y -
Returns:
the resulting translated Envelope

getCentroid

public Point getCentroid()
returns the centroid of an Envelope

Specified by:
getCentroid in interface Envelope
Returns:
centroid of an Envelope

toString

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

deegree 2.5 (2011/06/29 09:44 build-8-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org