org.gvsig.fmap.geom.primitive
Interface Envelope

All Superinterfaces:
Cloneable, Persistent
All Known Implementing Classes:
DefaultEnvelope, Envelope2D, Envelope3D

public interface Envelope
extends Persistent, Cloneable

This interface is equivalent to the GM_Envelope specified in ISO 19107. A minimum bounding box or rectangle. Regardless of dimension, an Envelope can be represented without ambiguity as two direct positions (coordinate points). To encode an Envelope, it is sufficient to encode these two points. This is consistent with all of the data types in this specification, their state is represented by their publicly accessible attributes.

Author:
Jorge Piera
See Also:
ISO 19107

Method Summary
 void add(Envelope envelope)
          Adds a envelope to the current envelope.
 boolean contains(Envelope envelope)
          Returns true if the new envelope is contained in the current envelope.
 Envelope convert(org.cresques.cts.ICoordTrans trans)
          Converts the envelope to other coordinate reference system
 double getCenter(int dimension)
          Returns the center ordinate along the specified dimension.
 int getDimension()
          The length of coordinate sequence (the number of entries) in this envelope.
 Geometry getGeometry()
          It returns the equivalent of an envelope like a geometry.
 double getLength(int dimension)
          Returns the envelope length along the specified dimension.
 Point 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 getMinimum(int dimension)
          Returns the minimal ordinate along the specified dimension.
 Point getUpperCorner()
          A coordinate position consisting of all the maximal ordinates for each dimension for all points within the Envelope.
 boolean intersects(Envelope envelope)
          Returns true if the new envelope intersects with the current envelope.
 boolean isEmpty()
          Gets if the envelope is null or not.
 void setLowerCorner(Point point)
          Sets the coordinate position consisting of all the minimal ordinates for each dimension for all points within the Envelope.
 void setUpperCorner(Point upperCorner)
          Sets the coordinate position consisting of all the maximal ordinates for each dimension for all points within the Envelope.
 
Methods inherited from interface org.gvsig.tools.persistence.Persistent
loadFromState, saveToState
 
Methods inherited from interface org.gvsig.tools.lang.Cloneable
clone
 

Method Detail

getCenter

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

Parameters:
dimension. - The dimension
Returns:
The value of the ordinate.
Throws:
EnvelopeNotInitializedException - if the envelope is empty.

getDimension

int getDimension()
The length of coordinate sequence (the number of entries) in this envelope.

Returns:
The dimension of the envelope.

getLength

double getLength(int dimension)
Returns the envelope length along the specified dimension.

Parameters:
dimension - The dimension.
Returns:
The envelope length along a dimension.
Throws:
EnvelopeNotInitializedException - if the envelope is empty.

getLowerCorner

Point getLowerCorner()
A coordinate position consisting of all the minimal ordinates for each dimension for all points within the Envelope.

Returns:
The lower corner.

setLowerCorner

void setLowerCorner(Point point)
Sets the coordinate position consisting of all the minimal ordinates for each dimension for all points within the Envelope.

Parameters:
point - The lower corner.

getMaximum

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

Parameters:
dimension - The dimension.
Returns:
The maximum value
Throws:
EnvelopeNotInitializedException - if the envelope is empty.

getMinimum

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

Parameters:
dimension - The dimension.
Returns:
The minimum value.
Throws:
EnvelopeNotInitializedException - if the envelope is empty.

getUpperCorner

Point getUpperCorner()
A coordinate position consisting of all the maximal ordinates for each dimension for all points within the Envelope.

Returns:
The upper corner

setUpperCorner

void setUpperCorner(Point upperCorner)
Sets the coordinate position consisting of all the maximal ordinates for each dimension for all points within the Envelope.

Parameters:
point - The upper corner.

add

void add(Envelope envelope)
Adds a envelope to the current envelope.

Parameters:
envelope - The envelope to add.

getGeometry

Geometry getGeometry()
It returns the equivalent of an envelope like a geometry.

Returns:
A geometry that contains the same area that the envelope.
Throws:
EnvelopeNotInitializedException - if the envelope is empty.

contains

boolean contains(Envelope envelope)
Returns true if the new envelope is contained in the current envelope.

Parameters:
envelope - The envelope to compare.
Returns:
If the current envelope contains the new envelope

intersects

boolean intersects(Envelope envelope)
Returns true if the new envelope intersects with the current envelope.

Parameters:
envelope - The envelope to compare.
Returns:
If the current envelope intersects with the new envelope

convert

Envelope convert(org.cresques.cts.ICoordTrans trans)
Converts the envelope to other coordinate reference system

Parameters:
trans - The CRS conversor
Returns:
A new envelope in other CRS
Throws:
EnvelopeNotInitializedException - if the envelope is empty.

isEmpty

boolean isEmpty()
Gets if the envelope is null or not. Is Empty means that the lower and upper corner are null.

Returns:
null or not if is empty.


Copyright © 2004-2012 gvSIG. All Rights Reserved.