public class GeographicBoundingBoxImpl extends GeographicExtentImpl implements GeographicBoundingBox
Modifier and Type | Field and Description |
---|---|
static GeographicBoundingBox |
WORLD
A bounding box ranging from 180°W to 180°E and 90°S to 90°N.
|
LOGGER
Constructor and Description |
---|
GeographicBoundingBoxImpl()
Constructs an initially empty geographic bounding box.
|
GeographicBoundingBoxImpl(double westBoundLongitude,
double eastBoundLongitude,
double southBoundLatitude,
double northBoundLatitude)
Creates a geographic bounding box initialized to the specified values.
|
GeographicBoundingBoxImpl(Envelope envelope)
Constructs a geographic bounding box from the specified envelope.
|
GeographicBoundingBoxImpl(GeographicBoundingBox box)
Constructs a geographic bounding box initialized to the same values than the specified one.
|
GeographicBoundingBoxImpl(Rectangle2D bounds)
Constructs a geographic bounding box from the specified rectangle.
|
Modifier and Type | Method and Description |
---|---|
void |
add(GeographicBoundingBox box)
Adds a geographic bounding box to this box.
|
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.
|
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 extent.
|
void |
intersect(GeographicBoundingBox box)
Sets this bounding box to the intersection of this box with the specified one.
|
boolean |
isEmpty()
Returns
true if this bounding box is empty. |
void |
setBounds(double westBoundLongitude,
double eastBoundLongitude,
double southBoundLatitude,
double northBoundLatitude)
Sets the bounding box to the specified values.
|
void |
setBounds(GeographicBoundingBox box)
Sets the bounding box to the same values than the specified box.
|
void |
setEastBoundLongitude(double newValue)
Set the eastern-most coordinate of the limit of the dataset extent.
|
void |
setNorthBoundLatitude(double newValue)
Set the northern-most, coordinate of the limit of the dataset extent.
|
void |
setSouthBoundLatitude(double newValue)
Set the southern-most coordinate of the limit of the dataset extent.
|
void |
setWestBoundLongitude(double newValue)
Set the western-most coordinate of the limit of the dataset extent.
|
String |
toString()
Returns a string representation of this extent using a default angle pattern.
|
static String |
toString(GeographicBoundingBox box,
String pattern,
Locale locale)
Returns a string representation of the specified extent using the specified angle pattern and
locale.
|
getInclusion, setInclusion
ensureNonNull, getStandard
checkWritePermission, clone, copyCollection, copyList, freeze, isModifiable, nonNullCollection, nonNullList, nonNullSet, unmodifiable
asMap, asTree, getInterface
getInclusion
public static final GeographicBoundingBox WORLD
public GeographicBoundingBoxImpl()
public GeographicBoundingBoxImpl(GeographicBoundingBox box)
box
- The existing box to use for initializing this geographic bounding box.public GeographicBoundingBoxImpl(Envelope envelope) throws TransformException
When coordinate transformation is required, the target geographic CRS is not necessarly WGS84. This method preserves the same ellipsoid than in the envelope CRS when possible. This is because geographic bounding box are only approximative and the ISO specification do not mandates a particular CRS, so we avoid transformations that are not strictly necessary.
Note: This constructor is available only if the referencing module is on the classpath.
envelope
- The envelope to use for initializing this geographic bounding box.UnsupportedOperationException
- if the referencing module is not on the classpath.TransformException
- if the envelope can't be transformed.public GeographicBoundingBoxImpl(Rectangle2D bounds)
bounds
- The rectangle to use for initializing this geographic bounding box.public GeographicBoundingBoxImpl(double westBoundLongitude, double eastBoundLongitude, double southBoundLatitude, double northBoundLatitude)
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).
westBoundLongitude
- The minimal x value.eastBoundLongitude
- The maximal x value.southBoundLatitude
- The minimal y value.northBoundLatitude
- The maximal y value.public double getWestBoundLongitude()
getWestBoundLongitude
in interface GeographicBoundingBox
public void setWestBoundLongitude(double newValue)
newValue
- The western-most longitude between -180 and +180°.public double getEastBoundLongitude()
getEastBoundLongitude
in interface GeographicBoundingBox
public void setEastBoundLongitude(double newValue)
newValue
- The eastern-most longitude between -180 and +180°.public double getSouthBoundLatitude()
getSouthBoundLatitude
in interface GeographicBoundingBox
public void setSouthBoundLatitude(double newValue)
newValue
- The southern-most latitude between -90 and +90°.public double getNorthBoundLatitude()
getNorthBoundLatitude
in interface GeographicBoundingBox
public void setNorthBoundLatitude(double newValue)
newValue
- The northern-most latitude between -90 and +90°.public void setBounds(double westBoundLongitude, double eastBoundLongitude, double southBoundLatitude, double northBoundLatitude)
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).
westBoundLongitude
- The minimal x value.eastBoundLongitude
- The maximal x value.southBoundLatitude
- The minimal y value.northBoundLatitude
- The maximal y value.public void setBounds(GeographicBoundingBox box)
box
- The geographic bounding box to use for setting the values of this box.public void add(GeographicBoundingBox box)
box
- The geographic bounding box to add to this box.public void intersect(GeographicBoundingBox box)
box
- The geographic bounding box to intersect with this box.public boolean isEmpty()
true
if this bounding box is empty.true
if this box is empty.public boolean equals(Object object)
equals
in class AbstractMetadata
object
- The object to compare for equality.true
if the given object is equals to this box.public int hashCode()
hashCode
in class AbstractMetadata
public String toString()
toString
in class AbstractMetadata
public static String toString(GeographicBoundingBox box, String pattern, Locale locale)
AngleFormat
for a description of angle patterns.box
- The bounding box to format.pattern
- The angle pattern (e.g. DD°MM'SS.s"
.locale
- The locale, or null
for the default one.Copyright © 1996–2019 Geotools. All rights reserved.