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
AnExtent
containing 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 double
eastBoundLongitude
The eastern-most coordinate of the limit of the dataset extent.protected double
northBoundLatitude
The northern-most, coordinate of the limit of the dataset extent.protected double
southBoundLatitude
The southern-most coordinate of the limit of the dataset extent.protected double
westBoundLongitude
The western-most coordinate of the limit of the dataset extent.static SimpleGeographicBoundingBox
WORLD
An 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 boolean
equals(Object object)
Compares this geographic bounding box with the specified object for equality.double
getEastBoundLongitude()
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.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).double
getNorthBoundLatitude()
Returns the northern-most, coordinate of the limit of the dataset extent.double
getSouthBoundLatitude()
Returns the southern-most coordinate of the limit of the dataset extent.double
getWestBoundLongitude()
Returns the western-most coordinate of the limit of the dataset extent.int
hashCode()
Returns a hash code value for this bounding box.String
toString()
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 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 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:
getWestBoundLongitude
in 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:
getEastBoundLongitude
in 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:
getSouthBoundLatitude
in 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:
getNorthBoundLatitude
in 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:
getInclusion
in interfaceGeographicExtent
- Returns:
true
for inclusion, orfalse
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 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.
-
-