Class SimpleGeographicBoundingBox

Object
SimpleGeographicBoundingBox
All Implemented Interfaces:
Extent, GeographicBoundingBox, GeographicExtent

public class SimpleGeographicBoundingBox extends Object implements GeographicBoundingBox, Extent
An Extent containing only a single GeographicBoundingBox. In order to keep the model simpler, this simple geographic bounding box is also an extent with no vertical or temporal elements.
Since:
3.1
  • Field Details

    • WORLD

      public static final SimpleGeographicBoundingBox WORLD
      An extent and a bounding box ranging from 180°W to 180°E and 90°S to 90°N.
    • westBoundLongitude

      protected final double westBoundLongitude
      The western-most coordinate of the limit of the dataset extent. The value is expressed in longitude in decimal degrees (positive east).
    • eastBoundLongitude

      protected final double eastBoundLongitude
      The eastern-most coordinate of the limit of the dataset extent. The value is expressed in longitude in decimal degrees (positive east).
    • southBoundLatitude

      protected final double southBoundLatitude
      The southern-most coordinate of the limit of the dataset extent. The value is expressed in latitude in decimal degrees (positive north).
    • northBoundLatitude

      protected final double northBoundLatitude
      The northern-most, coordinate of the limit of the dataset extent. The value is expressed in latitude in decimal degrees (positive north).
  • Constructor Details

    • SimpleGeographicBoundingBox

      public SimpleGeographicBoundingBox(GeographicBoundingBox box)
      Constructs a geographic bounding box initialized to the same values than the specified one.
      Parameters:
      box - the existing box to use for initializing this geographic bounding box.
    • SimpleGeographicBoundingBox

      public SimpleGeographicBoundingBox(Rectangle2D bounds)
      Constructs a geographic bounding box from the specified rectangle. The rectangle is assumed in WGS84 CRS.
      Parameters:
      bounds - the rectangle to use for initializing this geographic bounding box.
    • SimpleGeographicBoundingBox

      public SimpleGeographicBoundingBox(double westBoundLongitude, double eastBoundLongitude, double southBoundLatitude, double northBoundLatitude) throws IllegalArgumentException
      Creates a geographic bounding box initialized to the specified values.

      Caution: Arguments are expected in the same order than they appear in the ISO 19115 specification. This is different than the order commonly found in Java world, which is rather (xmin, ymin, xmax, ymax).

      Parameters:
      westBoundLongitude - the minimal x value.
      eastBoundLongitude - the maximal x value.
      southBoundLatitude - the minimal y value.
      northBoundLatitude - the maximal y value.
      Throws:
      IllegalArgumentException - if (west bound > east bound) or (south bound > north bound). Note that NaN values are allowed.
  • Method Details

    • getWestBoundLongitude

      public double getWestBoundLongitude()
      Returns the western-most coordinate of the limit of the dataset extent. The value is expressed in longitude in decimal degrees (positive east).
      Specified by:
      getWestBoundLongitude in interface GeographicBoundingBox
      Returns:
      the western-most longitude between -180 and +180°.
    • getEastBoundLongitude

      public double getEastBoundLongitude()
      Returns the eastern-most coordinate of the limit of the dataset extent. The value is expressed in longitude in decimal degrees (positive east).
      Specified by:
      getEastBoundLongitude in interface GeographicBoundingBox
      Returns:
      the eastern-most longitude between -180 and +180°.
    • getSouthBoundLatitude

      public double getSouthBoundLatitude()
      Returns the southern-most coordinate of the limit of the dataset extent. The value is expressed in latitude in decimal degrees (positive north).
      Specified by:
      getSouthBoundLatitude in interface GeographicBoundingBox
      Returns:
      the southern-most latitude between -90 and +90°.
    • getNorthBoundLatitude

      public double getNorthBoundLatitude()
      Returns the northern-most, coordinate of the limit of the dataset extent. The value is expressed in latitude in decimal degrees (positive north).
      Specified by:
      getNorthBoundLatitude in interface GeographicBoundingBox
      Returns:
      the northern-most latitude between -90 and +90°.
    • getInclusion

      public Boolean getInclusion()
      Indication of whether the bounding box encompasses an area covered by the data (inclusion) or an area where data is not present (exclusion). The default implementation unconditionally returns Boolean.TRUE.
      Specified by:
      getInclusion in interface GeographicExtent
      Returns:
      true for inclusion, or false for exclusion.
    • getGeographicElements

      public Collection<? extends GeographicExtent> getGeographicElements()
      Provides geographic component of the extent of the referring object. The default implementation returns a singleton containing only this geographic bounding box.
      Specified by:
      getGeographicElements in interface Extent
      Returns:
      the geographic extent, or an empty set if none.
    • equals

      public boolean equals(Object object)
      Compares this geographic bounding box with the specified object for equality.
      Overrides:
      equals in class Object
      Parameters:
      object - the object to compare for equality.
      Returns:
      true if the given object is equal to this box.
    • hashCode

      public int hashCode()
      Returns a hash code value for this bounding box.
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Returns a string representation of this extent.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this box.