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 Type
    Method
    Description
    void
    add(Geometry geometry)
    Utility method to add the envelop of geometry to the current envelope.
    void
    add(Envelope envelope)
    Adds a envelope to the current envelope.
    void
    Centers the envelope to a given point
    void
     
    boolean
    contains(Envelope envelope)
    Returns true if the new envelope is contained in the current envelope.
    convert(org.gvsig.crs.projection.lib.CoordinateTransformation trans)
    Converts the envelope to other coordinate reference system
     
    double
    getCenter(int dimension)
    Returns the center ordinate along the specified dimension.
    int
    The length of coordinate sequence (the number of entries) in this envelope.
    It returns the equivalent of an envelope like a geometry.
    double
    getLength(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.
    double
    getMaximum(int dimension)
    Returns the maximal ordinate along the specified dimension.
    double
    getMinimum(int dimension)
    Returns the minimal ordinate along the specified dimension.
    org.gvsig.crs.projection.lib.Projection
     
    A coordinate position consisting of all the maximal ordinates for each dimension for all points within the Envelope.
    boolean
     
    boolean
     
    boolean
    intersects(Geometry geometry)
    Returns true if the geometry intersects with the current envelope.
    boolean
    intersects(Envelope envelope)
    Returns true if the new envelope intersects with the current envelope.
    boolean
     
    boolean
    isCollapsed(int subtype)
     
    boolean
    Gets if the envelope is null or not.
    void
    Sets the coordinate position consisting of all the minimal ordinates for each dimension for all points within the Envelope.
    void
    setProjection(org.gvsig.crs.projection.lib.Projection projection)
     
    void
    setProjectionIffNull(org.gvsig.crs.projection.lib.Projection projection)
     
    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.lang.Cloneable

    clone

    Methods 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

      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:
      upperCorner - The upper corner.
    • add

      void add(Envelope envelope)
      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

      void add(Geometry geometry)
      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

      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
    • intersects

      boolean intersects(Geometry geometry)
      Returns true if the geometry intersects with the current envelope.
      Parameters:
      geometry - The geometry to compare.
      Returns:
      If the current envelope intersects with the geometry
    • convert

      Envelope convert(org.gvsig.crs.projection.lib.CoordinateTransformation 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.
    • clear

      void clear()
    • centerTo

      void centerTo(Point p)
      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()