Package org.opengis.example.metadata
Class SimpleGeographicBoundingBox
- Object
-
- SimpleGeographicBoundingBox
-
- All Implemented Interfaces:
Serializable,Extent,GeographicBoundingBox,GeographicExtent
public class SimpleGeographicBoundingBox extends Object implements GeographicBoundingBox, Extent, Serializable
AnExtentcontaining only a singleGeographicBoundingBox. 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
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected doubleeastBoundLongitudeThe eastern-most coordinate of the limit of the dataset extent.protected doublenorthBoundLatitudeThe northern-most, coordinate of the limit of the dataset extent.protected doublesouthBoundLatitudeThe southern-most coordinate of the limit of the dataset extent.protected doublewestBoundLongitudeThe western-most coordinate of the limit of the dataset extent.static SimpleGeographicBoundingBoxWORLDAn extent and a bounding box ranging from 180°W to 180°E and 90°S to 90°N.
-
Constructor Summary
Constructors Constructor Description SimpleGeographicBoundingBox(double westBoundLongitude, double eastBoundLongitude, double southBoundLatitude, double northBoundLatitude)Creates a geographic bounding box initialized to the specified values.SimpleGeographicBoundingBox(Rectangle2D bounds)Constructs a geographic bounding box from the specified rectangle.SimpleGeographicBoundingBox(GeographicBoundingBox box)Constructs a geographic bounding box initialized to the same values than the specified one.
-
Method Summary
Modifier and Type Method Description booleanequals(Object object)Compares this geographic bounding box with the specified object for equality.doublegetEastBoundLongitude()Returns the eastern-most coordinate of the limit of the dataset extent.Collection<? extends GeographicExtent>getGeographicElements()Provides geographic component of the extent of the referring object.BooleangetInclusion()Indication of whether the bounding box encompasses an area covered by the data (inclusion) or an area where data is not present (exclusion).doublegetNorthBoundLatitude()Returns the northern-most, coordinate of the limit of the dataset extent.doublegetSouthBoundLatitude()Returns the southern-most coordinate of the limit of the dataset extent.doublegetWestBoundLongitude()Returns the western-most coordinate of the limit of the dataset extent.inthashCode()Returns a hash code value for this bounding box.StringtoString()Returns a string representation of this extent.-
Methods inherited from interface Extent
getDescription, getTemporalElements, getVerticalElements
-
-
-
-
Field Detail
-
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 Detail
-
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 IllegalArgumentExceptionCreates 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 Detail
-
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:
getWestBoundLongitudein interfaceGeographicBoundingBox- 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:
getEastBoundLongitudein interfaceGeographicBoundingBox- 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:
getSouthBoundLatitudein interfaceGeographicBoundingBox- 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:
getNorthBoundLatitudein interfaceGeographicBoundingBox- 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 returnsBoolean.TRUE.- Specified by:
getInclusionin interfaceGeographicExtent- Returns:
truefor inclusion, orfalsefor 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:
getGeographicElementsin interfaceExtent- 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.
-
hashCode
public int hashCode()
Returns a hash code value for this bounding box.
-
-