Package org.gvsig.fmap.geom.primitive
Interface Envelope
- All Superinterfaces:
Cloneable,org.gvsig.tools.lang.Cloneable,org.gvsig.tools.persistence.Persistent
public interface Envelope
extends org.gvsig.tools.persistence.Persistent, org.gvsig.tools.lang.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:
-
Method Summary
Modifier and TypeMethodDescriptionvoidUtility method to add the envelop of geometry to the current envelope.voidAdds a envelope to the current envelope.voidCenters the envelope to a given pointvoidclear()booleanReturnstrueif the new envelope is contained in the current envelope.convert(org.gvsig.crs.projection.lib.CoordinateTransformation trans) Converts the envelope to other coordinate reference systemgetBox2D()doublegetCenter(int dimension) Returns the center ordinate along the specified dimension.intThe length of coordinate sequence (the number of entries) in this envelope.It returns the equivalent of an envelope like a geometry.doublegetLength(int dimension) Returns the envelope length along the specified dimension.A coordinate position consisting of all the minimal ordinates for each dimension for all points within the Envelope.doublegetMaximum(int dimension) Returns the maximal ordinate along the specified dimension.doublegetMinimum(int dimension) Returns the minimal ordinate along the specified dimension.org.gvsig.crs.projection.lib.ProjectionA coordinate position consisting of all the maximal ordinates for each dimension for all points within the Envelope.booleanhasM()booleanhasZ()booleanintersects(Geometry geometry) Returnstrueif the geometry intersects with the current envelope.booleanintersects(Envelope envelope) Returnstrueif the new envelope intersects with the current envelope.booleanbooleanisCollapsed(int subtype) booleanisEmpty()Gets if the envelope isnullor not.voidsetLowerCorner(Point point) Sets the coordinate position consisting of all the minimal ordinates for each dimension for all points within the Envelope.voidsetProjection(org.gvsig.crs.projection.lib.Projection projection) voidsetProjectionIffNull(org.gvsig.crs.projection.lib.Projection projection) voidsetUpperCorner(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.lang.Cloneable
cloneMethods inherited from interface org.gvsig.tools.persistence.Persistent
loadFromState, saveToState
-
Method Details
-
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
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
Sets the coordinate position consisting of all the maximal ordinates for each dimension for all points within the Envelope.- Parameters:
upperCorner- The upper corner.
-
add
Adds a envelope to the current envelope. If the envelope to add is null or empty do not modify the current enevelop and don't throw a exception.- Parameters:
envelope- The envelope to add.
-
add
Utility method to add the envelop of geometry to the current envelope. Is equivalent to:add(geometry.getEnvelope())- Parameters:
geometry- The geometry 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.
-
getBox2D
Geometry getBox2D() -
contains
Returnstrueif 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
Returnstrueif the new envelope intersects with the current envelope.- Parameters:
envelope- The envelope to compare.- Returns:
- If the current envelope intersects with the new envelope
-
intersects
Returnstrueif the geometry intersects with the current envelope.- Parameters:
geometry- The geometry to compare.- Returns:
- If the current envelope intersects with the geometry
-
convert
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 isnullor not. Is Empty means that the lower and upper corner arenull.- Returns:
nullor not if is empty.
-
clear
void clear() -
centerTo
Centers the envelope to a given point- Parameters:
p- Point to be centered
-
setProjection
void setProjection(org.gvsig.crs.projection.lib.Projection projection) -
setProjectionIffNull
void setProjectionIffNull(org.gvsig.crs.projection.lib.Projection projection) -
getProjection
org.gvsig.crs.projection.lib.Projection getProjection() -
isCollapsed
boolean isCollapsed() -
isCollapsed
boolean isCollapsed(int subtype) -
hasZ
boolean hasZ() -
hasM
boolean hasM()
-