Module org.opengis.geoapi.example
Package org.opengis.example.metadata
Class SimpleGeographicBoundingBox
Object
SimpleGeographicBoundingBox
- All Implemented Interfaces:
Extent
,GeographicBoundingBox
,GeographicExtent
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 Summary
Modifier and TypeFieldDescriptionprotected final double
The eastern-most coordinate of the limit of the dataset extent.protected final double
The northern-most, coordinate of the limit of the dataset extent.protected final double
The southern-most coordinate of the limit of the dataset extent.protected final double
The western-most coordinate of the limit of the dataset extent.static final SimpleGeographicBoundingBox
An extent and a bounding box ranging from 180°W to 180°E and 90°S to 90°N. -
Constructor Summary
ConstructorDescriptionSimpleGeographicBoundingBox
(double westBoundLongitude, double eastBoundLongitude, double southBoundLatitude, double northBoundLatitude) Creates a geographic bounding box initialized to the specified values.Constructs a geographic bounding box from the specified rectangle.Constructs a geographic bounding box initialized to the same values than the specified one. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares this geographic bounding box with the specified object for equality.double
Returns the eastern-most coordinate of the limit of the dataset extent.Collection<? extends GeographicExtent>
Provides geographic component of the extent of the referring object.Indication of whether the bounding box encompasses an area covered by the data (inclusion) or an area where data is not present (exclusion).double
Returns the northern-most, coordinate of the limit of the dataset extent.double
Returns the southern-most coordinate of the limit of the dataset extent.double
Returns the western-most coordinate of the limit of the dataset extent.int
hashCode()
Returns a hash code value for this bounding box.toString()
Returns a string representation of this extent.Methods inherited from interface Extent
getDescription, getTemporalElements, getVerticalElements
-
Field Details
-
WORLD
An extent and a bounding box ranging from 180°W to 180°E and 90°S to 90°N. -
westBoundLongitude
protected final double westBoundLongitudeThe 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 eastBoundLongitudeThe 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 southBoundLatitudeThe 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 northBoundLatitudeThe northern-most, coordinate of the limit of the dataset extent. The value is expressed in latitude in decimal degrees (positive north).
-
-
Constructor Details
-
SimpleGeographicBoundingBox
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
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 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
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
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
Compares this geographic bounding box with the specified object for equality. -
hashCode
public int hashCode()Returns a hash code value for this bounding box. -
toString
Returns a string representation of this extent.
-