Class DefaultSpatialTemporalExtent
java.lang.Object
org.apache.sis.metadata.AbstractMetadata
org.apache.sis.metadata.ModifiableMetadata
org.apache.sis.metadata.iso.ISOMetadata
org.apache.sis.metadata.iso.extent.DefaultTemporalExtent
org.apache.sis.metadata.iso.extent.DefaultSpatialTemporalExtent
- All Implemented Interfaces:
Serializable
,Emptiable
,LenientComparable
,IdentifiedObject
,org.opengis.metadata.extent.SpatialTemporalExtent
,org.opengis.metadata.extent.TemporalExtent
public class DefaultSpatialTemporalExtent
extends DefaultTemporalExtent
implements org.opengis.metadata.extent.SpatialTemporalExtent
Extent with respect to date/time and spatial boundaries.
The following properties are mandatory in a well-formed metadata according ISO 19115:
EX_SpatialTemporalExtent
├─extent……………………………………
The date and time for the content of the dataset.
└─spatialExtent…………………
The spatial extent component of composite spatial and temporal extent.Limitations
- Instances of this class are not synchronized for multi-threading. Synchronization, if needed, is caller's responsibility.
- Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
Serialization support is appropriate for short term storage or RMI between applications running the
same version of Apache SIS. For long term storage, use
XML
instead.
- Since:
- 0.3
- Version:
- 1.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.metadata.ModifiableMetadata
ModifiableMetadata.State
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
Serial number for inter-operability with different versions.private Collection
<org.opengis.metadata.extent.GeographicExtent> The spatial extent component of composite spatial and temporal extent.private org.opengis.metadata.extent.VerticalExtent
Vertical extent component.Fields inherited from class org.apache.sis.metadata.iso.ISOMetadata
identifiers
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an initially empty spatial-temporal extent.DefaultSpatialTemporalExtent
(org.opengis.metadata.extent.GeographicExtent spatialExtent, org.opengis.metadata.extent.VerticalExtent verticalExtent, org.opengis.metadata.extent.TemporalExtent extent) Constructs a new spatial-temporal extent initialized to the specified values.DefaultSpatialTemporalExtent
(org.opengis.metadata.extent.SpatialTemporalExtent object) Constructs a new instance initialized with the values from the specified metadata object. -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultSpatialTemporalExtent
castOrCopy
(org.opengis.metadata.extent.SpatialTemporalExtent object) Returns a SIS metadata implementation with the values of the given arbitrary implementation.Collection
<org.opengis.metadata.extent.GeographicExtent> Returns the spatial extent component of composite spatial and temporal extent.org.opengis.metadata.extent.VerticalExtent
Returns the vertical extent component.void
setBounds
(org.opengis.geometry.Envelope envelope) Sets this spatiotemporal extent to values inferred from the specified envelope.void
setSpatialExtent
(Collection<? extends org.opengis.metadata.extent.GeographicExtent> newValues) Sets the spatial extent component of composite spatial and temporal extent.void
setVerticalExtent
(org.opengis.metadata.extent.VerticalExtent newValue) Sets the vertical extent component.Methods inherited from class org.apache.sis.metadata.iso.extent.DefaultTemporalExtent
castOrCopy, getEndTime, getExtent, getStartTime, getTime, intersect, setBounds, setExtent
Methods inherited from class org.apache.sis.metadata.iso.ISOMetadata
getIdentifier, getIdentifierMap, getIdentifiers, getStandard, setIdentifier, transitionTo
Methods inherited from class org.apache.sis.metadata.ModifiableMetadata
checkWritePermission, collectionType, copyCollection, copyList, copyMap, copySet, deepCopy, nonNullCollection, nonNullList, nonNullMap, nonNullSet, singleton, state, writeCollection, writeList, writeMap, writeSet
Methods inherited from class org.apache.sis.metadata.AbstractMetadata
asMap, asTreeTable, equals, equals, getInterface, hashCode, isEmpty, prune, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opengis.metadata.extent.TemporalExtent
getExtent
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial number for inter-operability with different versions.- See Also:
-
spatialExtent
The spatial extent component of composite spatial and temporal extent. -
verticalExtent
private org.opengis.metadata.extent.VerticalExtent verticalExtentVertical extent component.
-
-
Constructor Details
-
DefaultSpatialTemporalExtent
public DefaultSpatialTemporalExtent()Constructs an initially empty spatial-temporal extent. -
DefaultSpatialTemporalExtent
public DefaultSpatialTemporalExtent(org.opengis.metadata.extent.GeographicExtent spatialExtent, org.opengis.metadata.extent.VerticalExtent verticalExtent, org.opengis.metadata.extent.TemporalExtent extent) Constructs a new spatial-temporal extent initialized to the specified values.- Parameters:
spatialExtent
- the spatial extent component of composite spatial and temporal extent.verticalExtent
- the vertical extent component, ornull
if none.extent
- the date and time for the content of the dataset, ornull
if unspecified.- Since:
- 0.5
-
DefaultSpatialTemporalExtent
public DefaultSpatialTemporalExtent(org.opengis.metadata.extent.SpatialTemporalExtent object) Constructs a new instance initialized with the values from the specified metadata object. This is a shallow copy constructor, because the other metadata contained in the given object are not recursively copied.- Parameters:
object
- the metadata to copy values from, ornull
if none.- See Also:
-
-
Method Details
-
castOrCopy
public static DefaultSpatialTemporalExtent castOrCopy(org.opengis.metadata.extent.SpatialTemporalExtent object) Returns a SIS metadata implementation with the values of the given arbitrary implementation. This method performs the first applicable action in the following choices:- If the given object is
null
, then this method returnsnull
. - Otherwise if the given object is already an instance of
DefaultSpatialTemporalExtent
, then it is returned unchanged. - Otherwise a new
DefaultSpatialTemporalExtent
instance is created using the copy constructor and returned. Note that this is a shallow copy operation, because the other metadata contained in the given object are not recursively copied.
- Parameters:
object
- the object to get as a SIS implementation, ornull
if none.- Returns:
- a SIS implementation containing the values of the given object (may be the
given object itself), or
null
if the argument was null.
- If the given object is
-
getSpatialExtent
Returns the spatial extent component of composite spatial and temporal extent.- Specified by:
getSpatialExtent
in interfaceorg.opengis.metadata.extent.SpatialTemporalExtent
- Returns:
- the list of geographic extents (never
null
).
-
setSpatialExtent
public void setSpatialExtent(Collection<? extends org.opengis.metadata.extent.GeographicExtent> newValues) Sets the spatial extent component of composite spatial and temporal extent.- Parameters:
newValues
- the new spatial extent.
-
getVerticalExtent
@UML(identifier="verticalExtent", obligation=OPTIONAL, specification=ISO_19115) public org.opengis.metadata.extent.VerticalExtent getVerticalExtent()Returns the vertical extent component.- Returns:
- vertical extent component, or
null
if none. - Since:
- 0.5
-
setVerticalExtent
public void setVerticalExtent(org.opengis.metadata.extent.VerticalExtent newValue) Sets the vertical extent component.- Parameters:
newValue
- the new vertical extent component.- Since:
- 0.5
-
setBounds
public void setBounds(org.opengis.geometry.Envelope envelope) throws org.opengis.referencing.operation.TransformException Sets this spatiotemporal extent to values inferred from the specified envelope. The given envelope shall have at least a spatial, vertical or temporal component.The spatial component is handled as below:
- If the given envelope has an horizontal component, then:
- If the collection of spatial extents contains a
GeographicBoundingBox
, then that bounding box will be updated or replaced by a bounding box containing the spatial component of the given envelope. - Otherwise a new
DefaultGeographicBoundingBox
with the spatial component of the given envelope is added to the list of spatial extents.
- If the collection of spatial extents contains a
- All extraneous geographic extents are removed. Non-geographic extents (e.g. descriptions and polygons) are left unchanged.
Other dimensions are handled in a more straightforward way:
- The vertical extent is set to the vertical component
of the given envelope, or
null
if none. - The temporal extent is set to the temporal component
of the given envelope, or
null
if none.
sis-referencing
module is available on the classpath.- Overrides:
setBounds
in classDefaultTemporalExtent
- Parameters:
envelope
- the envelope to use for setting this spatiotemporal extent.- Throws:
UnsupportedOperationException
- if the referencing module is not on the classpath.org.opengis.referencing.operation.TransformException
- if the envelope cannot be transformed to a temporal extent.- See Also:
- If the given envelope has an horizontal component, then:
-