org.geotoolkit.metadata.iso.extent
Class DefaultExtent

Object
  extended by AbstractMetadata
      extended by ModifiableMetadata
          extended by MetadataEntity
              extended by DefaultExtent
All Implemented Interfaces:
Serializable, Cloneable, LenientComparable, IdentifiedObject, Extent

@ThreadSafe
public class DefaultExtent
extends MetadataEntity
implements Extent

Information about spatial, vertical, and temporal extent. This interface has four optional attributes (geographic elements, temporal elements, and vertical elements) and an element called description. At least one of the four shall be used.

Since:
2.1
Version:
3.19
Author:
Martin Desruisseaux (IRD, Geomatys), Touraïvane (IRD), Cédric Briançon (Geomatys)
See Also:
Serialized Form
Module:
metadata/geotk-metadata (download)    View source code for this class

Field Summary
static Extent WORLD
          A geographic extent ranging from 180°W to 180°E and 90°S to 90°N.
 
Fields inherited from class MetadataEntity
identifiers
 
Fields inherited from class AbstractMetadata
LOGGER
 
Constructor Summary
DefaultExtent()
          Constructs an initially empty extent.
DefaultExtent(Envelope envelope)
          Constructs an extent from the specified envelope.
DefaultExtent(Extent source)
          Constructs a metadata entity initialized with the values from the specified metadata.
 
Method Summary
 void addElements(Envelope envelope)
          Adds geographic, vertical or temporal extents inferred from the given envelope.
static DefaultExtent castOrCopy(Extent object)
          Returns a Geotk metadata implementation with the same values than the given arbitrary implementation.
 InternationalString getDescription()
          Returns the spatial and temporal extent for the referring object.
static GeographicBoundingBox getGeographicBoundingBox(Extent extent)
          Convenience method returning a single geographic bounding box from the specified extent.
 Collection<GeographicExtent> getGeographicElements()
          Provides geographic component of the extent of the referring object
 Collection<TemporalExtent> getTemporalElements()
          Provides temporal component of the extent of the referring object.
 Collection<VerticalExtent> getVerticalElements()
          Provides vertical component of the extent of the referring object.
 void setDescription(InternationalString newValue)
          Sets the spatial and temporal extent for the referring object.
 void setGeographicElements(Collection<? extends GeographicExtent> newValues)
          Sets geographic component of the extent of the referring object.
 void setTemporalElements(Collection<? extends TemporalExtent> newValues)
          Sets temporal component of the extent of the referring object.
 void setVerticalElements(Collection<? extends VerticalExtent> newValues)
          Sets vertical component of the extent of the referring object.
 
Methods inherited from class MetadataEntity
getIdentifier, getIdentifierMap, getIdentifiers, getStandard
 
Methods inherited from class ModifiableMetadata
checkWritePermission, clone, collectionType, copyCollection, copyList, copySet, freeze, isModifiable, nonNullCollection, nonNullList, nonNullSet, prune, unmodifiable
 
Methods inherited from class AbstractMetadata
asMap, asTree, asTreeTable, equals, equals, getInterface, hashCode, isEmpty, parse, toString
 
Methods inherited from class Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

WORLD

public static final Extent WORLD
A geographic extent ranging from 180°W to 180°E and 90°S to 90°N.

Since:
2.2
Constructor Detail

DefaultExtent

public DefaultExtent()
Constructs an initially empty extent.


DefaultExtent

public DefaultExtent(Extent source)
Constructs a metadata entity initialized with the values from the specified metadata.

Parameters:
source - The metadata to copy, or null if none.
Since:
2.4

DefaultExtent

public DefaultExtent(Envelope envelope)
              throws TransformException
Constructs an extent from the specified envelope. This method inspects the envelope CRS and creates a GeographicBoundingBox, VerticalExtent or TemporalExtent as needed.
Note: This constructor is available only if the referencing module is on the classpath.

Parameters:
envelope - The envelope to use for initializing this extent.
Throws:
UnsupportedOperationException - if the referencing module is not on the classpath.
TransformException - If a coordinate transformation was required and failed.
Since:
3.18
See Also:
addElements(Envelope), DefaultGeographicBoundingBox.DefaultGeographicBoundingBox(Envelope), DefaultVerticalExtent.DefaultVerticalExtent(Envelope), DefaultTemporalExtent.DefaultTemporalExtent(Envelope)
Method Detail

castOrCopy

public static DefaultExtent castOrCopy(Extent object)
Returns a Geotk metadata implementation with the same values than the given arbitrary implementation. If the given object is null, then this method returns null. Otherwise if the given object is already a Geotk implementation, then the given object is returned unchanged. Otherwise a new Geotk implementation is created and initialized to the attribute values of the given object, using a shallow copy operation (i.e. attributes are not cloned).

Parameters:
object - The object to get as a Geotk implementation, or null if none.
Returns:
A Geotk implementation containing the values of the given object (may be the given object itself), or null if the argument was null.
Since:
3.18

getDescription

public InternationalString getDescription()
Returns the spatial and temporal extent for the referring object.

Specified by:
getDescription in interface Extent

setDescription

public void setDescription(InternationalString newValue)
Sets the spatial and temporal extent for the referring object.

Parameters:
newValue - The new description.

getGeographicElements

public Collection<GeographicExtent> getGeographicElements()
Provides geographic component of the extent of the referring object

Specified by:
getGeographicElements in interface Extent

setGeographicElements

public void setGeographicElements(Collection<? extends GeographicExtent> newValues)
Sets geographic component of the extent of the referring object.

Parameters:
newValues - The new geographic elements.

getTemporalElements

public Collection<TemporalExtent> getTemporalElements()
Provides temporal component of the extent of the referring object.

Specified by:
getTemporalElements in interface Extent

setTemporalElements

public void setTemporalElements(Collection<? extends TemporalExtent> newValues)
Sets temporal component of the extent of the referring object.

Parameters:
newValues - The new temporal elements.

getVerticalElements

public Collection<VerticalExtent> getVerticalElements()
Provides vertical component of the extent of the referring object.

Specified by:
getVerticalElements in interface Extent

setVerticalElements

public void setVerticalElements(Collection<? extends VerticalExtent> newValues)
Sets vertical component of the extent of the referring object.

Parameters:
newValues - The new vertical elements.

addElements

public void addElements(Envelope envelope)
                 throws TransformException
Adds geographic, vertical or temporal extents inferred from the given envelope. The elements to add are inferred from the envelope CRS. This method does not check for duplicate values.
Note: This method is available only if the referencing module is on the classpath.

Parameters:
envelope - The envelope to use for inferring the additional extents.
Throws:
UnsupportedOperationException - if the referencing module is not on the classpath.
TransformException - If a coordinate transformation was required and failed.
Since:
3.18

getGeographicBoundingBox

public static GeographicBoundingBox getGeographicBoundingBox(Extent extent)
Convenience method returning a single geographic bounding box from the specified extent. If no bounding box was found, then this method returns null. If more than one box is found, then boxes are added together.

Parameters:
extent - The extent to convert to a geographic bounding box.
Returns:
A geographic bounding box extracted from the given extent.
Since:
2.2


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.