Interface Envelope


@UML(identifier="GM_Envelope", specification=ISO_19107) public interface Envelope
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.
Since:
1.0
See Also:
  • invalid @see
    org.opengis.coverage.grid.GridEnvelope
Departure from OGC/ISO abstract specification:
Extension for convenience without introduction of new functionality This interface was moved into the org.opengis.geometry package for convenience.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the envelope coordinate reference system, or null if unknown.
    int
    The length of coordinate sequence (the number of entries) in this envelope.
    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
    getMedian(int dimension)
    Returns the median ordinate along the specified dimension.
    double
    getMinimum(int dimension)
    Returns the minimal ordinate along the specified dimension.
    double
    getSpan(int dimension)
    Returns the envelope span (typically width or height) along the specified dimension.
    A coordinate position consisting of all the maximal ordinates for each dimension for all points within the Envelope.
  • Method Details

    • getCoordinateReferenceSystem

      CoordinateReferenceSystem getCoordinateReferenceSystem()
      Returns the envelope coordinate reference system, or null if unknown. If non-null, it shall be the same as lower corner and upper corner CRS.
      Returns:
      The envelope CRS, or null if unknown.
      Since:
      2.1
      Departure from OGC/ISO abstract specification:
      Extension for convenience without introduction of new functionality ISO does not define this method - the CRS or the dimension can be obtained only through one of the corner DirectPosition objects. GeoAPI adds this method for convenience as a more direct way of obtaining the information and to free the user from the need to choose an arbitrary corner (very defensive code might feel the need to get the value from both corners to check they were the same).
    • getDimension

      int getDimension()
      The length of coordinate sequence (the number of entries) in this envelope. Mandatory even when the coordinate reference system is unknown.
      Returns:
      The dimensionality of this envelope.
      Since:
      2.0
      Departure from OGC/ISO abstract specification:
      Extension for convenience without introduction of new functionality ISO does not define this method - the CRS or the dimension can be obtained only through one of the corner DirectPosition objects. GeoAPI adds this method for convenience as a more direct way of obtaining the information and to free the user from the need to choose an arbitrary corner (very defensive code might feel the need to get the value from both corners to check they were the same).
    • getLowerCorner

      A coordinate position consisting of all the minimal ordinates for each dimension for all points within the Envelope.
      Returns:
      The lower corner.
    • getUpperCorner

      A coordinate position consisting of all the maximal ordinates for each dimension for all points within the Envelope.
      Returns:
      The upper corner.
    • getMinimum

      double getMinimum(int dimension) throws IndexOutOfBoundsException
      Returns the minimal ordinate along the specified dimension. This is a shortcut for the following without the cost of creating a temporary DirectPosition object:
      getLowerCorner().getOrdinate(dimension)
      Parameters:
      dimension - The dimension for which to obtain the ordinate value.
      Returns:
      The minimal ordinate at the given dimension.
      Throws:
      IndexOutOfBoundsException - If the given index is negative or is equal or greater than the envelope dimension.
      Since:
      2.0
      See Also:
      Departure from OGC/ISO abstract specification:
      Extension for convenience without introduction of new functionality This method is not part of ISO specification. GeoAPI adds this method for convenience and efficiency, since some implementations might store the minimum and maximum ordinate values directly in the Envelope itself rather than in a contained DirectPosition corner.
    • getMaximum

      double getMaximum(int dimension) throws IndexOutOfBoundsException
      Returns the maximal ordinate along the specified dimension. This is a shortcut for the following without the cost of creating a temporary DirectPosition object:
      getUpperCorner().getOrdinate(dimension)
      Parameters:
      dimension - The dimension for which to obtain the ordinate value.
      Returns:
      The maximal ordinate at the given dimension.
      Throws:
      IndexOutOfBoundsException - If the given index is negative or is equal or greater than the envelope dimension.
      Since:
      2.0
      See Also:
      Departure from OGC/ISO abstract specification:
      Extension for convenience without introduction of new functionality This method is not part of ISO specification. GeoAPI adds this method for convenience and efficiency, since some implementations might store the minimum and maximum ordinate values directly in the Envelope itself rather than in a contained DirectPosition corner.
    • getMedian

      double getMedian(int dimension) throws IndexOutOfBoundsException
      Returns the median ordinate along the specified dimension. The result shall be equals (minus rounding error) to:
      (getMinimum(dimension) + getMaximum(dimension)) / 2
      Parameters:
      dimension - The dimension for which to obtain the ordinate value.
      Returns:
      The median ordinate at the given dimension.
      Throws:
      IndexOutOfBoundsException - If the given index is negative or is equal or greater than the envelope dimension.
      Since:
      2.2
      See Also:
      Departure from OGC/ISO abstract specification:
      Extension for convenience without introduction of new functionality This method is not part of ISO specification. GeoAPI adds this method for convenience and efficiency, since some implementations might store the minimum and maximum ordinate values directly in the Envelope itself rather than in a contained DirectPosition corner.
    • getSpan

      double getSpan(int dimension) throws IndexOutOfBoundsException
      Returns the envelope span (typically width or height) along the specified dimension. The result shall be equals (minus rounding error) to:
      getMaximum(dimension) - getMinimum(dimension)
      Parameters:
      dimension - The dimension for which to obtain the ordinate value.
      Returns:
      The span (typically width or height) at the given dimension.
      Throws:
      IndexOutOfBoundsException - If the given index is negative or is equal or greater than the envelope dimension.
      Since:
      2.2
      See Also:
      Departure from OGC/ISO abstract specification:
      Extension for convenience without introduction of new functionality This method is not part of ISO specification. GeoAPI adds this method for convenience and efficiency, since some implementations might store the minimum and maximum ordinate values directly in the Envelope itself rather than in a contained DirectPosition corner.