org.geotools.metadata.iso.extent
Class GeographicBoundingBoxImpl

java.lang.Object
  extended byorg.geotools.metadata.iso.MetadataEntity
      extended byorg.geotools.metadata.iso.extent.GeographicExtentImpl
          extended byorg.geotools.metadata.iso.extent.GeographicBoundingBoxImpl
All Implemented Interfaces:
java.lang.Cloneable, org.opengis.metadata.extent.GeographicBoundingBox, org.opengis.metadata.extent.GeographicExtent, java.io.Serializable

public class GeographicBoundingBoxImpl
extends GeographicExtentImpl
implements org.opengis.metadata.extent.GeographicBoundingBox

Geographic position of the dataset. This is only an approximate so specifying the co-ordinate reference system is unnecessary.

Since:
2.1
Version:
$Id: GeographicBoundingBoxImpl.java 18776 2006-03-22 11:36:21Z desruisseaux $
Author:
Martin Desruisseaux, Toura?vane
See Also:
Serialized Form

Field Summary
static org.opengis.metadata.extent.GeographicBoundingBox WORLD
          A bounding box ranging from 180?W to 180?E and 90?S to 90?N.
 
Fields inherited from class org.geotools.metadata.iso.MetadataEntity
LOGGER
 
Constructor Summary
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(org.opengis.spatialschema.geometry.Envelope envelope)
          Constructs a geographic bounding box from the specified envelope.
GeographicBoundingBoxImpl(org.opengis.metadata.extent.GeographicBoundingBox box)
          Constructs a geographic bounding box initialized to the same values than the specified one.
GeographicBoundingBoxImpl(java.awt.geom.Rectangle2D bounds)
          Constructs a geographic bounding box from the specified rectangle.
 
Method Summary
 void add(org.opengis.metadata.extent.GeographicBoundingBox box)
          Adds a geographic bounding box to this box.
 boolean equals(java.lang.Object object)
          Compares this geographic bounding box with the specified object for equality.
protected  void freeze()
          Declares this metadata and all its attributes as unmodifiable.
 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 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.
 java.lang.String toString()
          Returns a string representation of this extent using a default angle pattern.
static java.lang.String toString(org.opengis.metadata.extent.GeographicBoundingBox box, java.lang.String pattern, java.util.Locale locale)
          Returns a string representation of the specified extent using the specified angle pattern and locale.
 
Methods inherited from class org.geotools.metadata.iso.extent.GeographicExtentImpl
getInclusion, setInclusion
 
Methods inherited from class org.geotools.metadata.iso.MetadataEntity
appendLineSeparator, checkWritePermission, copyCollection, isModifiable, nonNullCollection, unmodifiable, unmodifiable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opengis.metadata.extent.GeographicExtent
getInclusion
 

Field Detail

WORLD

public static final org.opengis.metadata.extent.GeographicBoundingBox WORLD
A bounding box ranging from 180?W to 180?E and 90?S to 90?N.

Since:
2.2
Constructor Detail

GeographicBoundingBoxImpl

public GeographicBoundingBoxImpl()
Constructs an initially empty geographic bounding box.


GeographicBoundingBoxImpl

public GeographicBoundingBoxImpl(org.opengis.metadata.extent.GeographicBoundingBox box)
Constructs a geographic bounding box initialized to the same values than the specified one.

Since:
2.2

GeographicBoundingBoxImpl

public GeographicBoundingBoxImpl(org.opengis.spatialschema.geometry.Envelope envelope)
                          throws org.opengis.referencing.operation.TransformException
Constructs a geographic bounding box from the specified envelope. If the envelope contains a CRS, then the bounding box will be projected to the WGS 84 CRS. Otherwise, the envelope is assumed already in WGS 84 CRS.

Since:
2.2

GeographicBoundingBoxImpl

public GeographicBoundingBoxImpl(java.awt.geom.Rectangle2D bounds)
Constructs a geographic bounding box from the specified rectangle. The rectangle is assumed in WGS 84 CRS.


GeographicBoundingBoxImpl

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

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 interface org.opengis.metadata.extent.GeographicBoundingBox
Returns:
The western-most longitude between -180 and +180?.

setWestBoundLongitude

public void setWestBoundLongitude(double newValue)
Set the western-most coordinate of the limit of the dataset extent. The value is expressed in longitude in decimal degrees (positive east).


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 org.opengis.metadata.extent.GeographicBoundingBox
Returns:
The eastern-most longitude between -180 and +180?.

setEastBoundLongitude

public void setEastBoundLongitude(double newValue)
Set the eastern-most coordinate of the limit of the dataset extent. The value is expressed in longitude in decimal degrees (positive east).


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 org.opengis.metadata.extent.GeographicBoundingBox
Returns:
The southern-most latitude between -90 and +90?.

setSouthBoundLatitude

public void setSouthBoundLatitude(double newValue)
Set the southern-most coordinate of the limit of the dataset extent. The value is expressed in latitude in decimal degrees (positive north).


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 org.opengis.metadata.extent.GeographicBoundingBox
Returns:
The northern-most latitude between -90 and +90?.

setNorthBoundLatitude

public void setNorthBoundLatitude(double newValue)
Set the northern-most, coordinate of the limit of the dataset extent. The value is expressed in latitude in decimal degrees (positive north).


add

public void add(org.opengis.metadata.extent.GeographicBoundingBox box)
Adds a geographic bounding box to this box. If the inclusion status is the same for this box and the box to be added, then the resulting bounding box is the union of the two boxes. If the inclusion status are opposite (exclusion), then this method attempt to exclude the some area of specified box from this box. The resulting bounding box is smaller if the exclusion can be performed without ambiguity.

Since:
2.2

freeze

protected void freeze()
Declares this metadata and all its attributes as unmodifiable.

Overrides:
freeze in class GeographicExtentImpl

equals

public boolean equals(java.lang.Object object)
Compares this geographic bounding box with the specified object for equality.

Overrides:
equals in class GeographicExtentImpl

hashCode

public int hashCode()
Returns a hash code value for this extent.

Overrides:
hashCode in class GeographicExtentImpl

toString

public java.lang.String toString()
Returns a string representation of this extent using a default angle pattern.

Overrides:
toString in class GeographicExtentImpl

toString

public static java.lang.String toString(org.opengis.metadata.extent.GeographicBoundingBox box,
                                        java.lang.String pattern,
                                        java.util.Locale locale)
Returns a string representation of the specified extent using the specified angle pattern and locale. See AngleFormat for a description of angle patterns.

Parameters:
box - The bounding box to format.
pattern - The angle pattern (e.g. .
locale - The locale, or for the default one.
Since:
2.2


Copyright © GeoTools. All Rights Reserved.