Class TemporalAccessor
java.lang.Object
org.apache.sis.internal.referencing.TemporalAccessor
Convenience methods for accessing the temporal component of an object (envelope, grid geometry…).
- Since:
- 1.0
- Version:
- 1.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal int
Dimension of the temporal component.static final Instant[]
Empty array of instants.final DefaultTemporalCRS
Converter from floating point numbers to dates. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
TemporalAccessor
(int dim, org.opengis.referencing.crs.TemporalCRS crs) Creates a new accessor for the given coordinate reference system. -
Method Summary
Modifier and TypeMethodDescriptionInstant[]
getTimeBounds
(AbstractEnvelope envelope) Returns the lower and upper values in the given envelope.getTimeRange
(org.opengis.geometry.Envelope envelope) Returns the temporal range of given envelope.static TemporalAccessor
of
(org.opengis.referencing.crs.CoordinateReferenceSystem crs, int dim) Creates a new temporal accessor for elements at the given dimensions.(package private) void
setTemporalExtent
(org.opengis.geometry.Envelope envelope, DefaultTemporalExtent target) Copies the temporal extent from an envelope to a metadata object.
-
Field Details
-
EMPTY
Empty array of instants. -
dimension
public final int dimensionDimension of the temporal component. -
timeCRS
Converter from floating point numbers to dates.
-
-
Constructor Details
-
TemporalAccessor
private TemporalAccessor(int dim, org.opengis.referencing.crs.TemporalCRS crs) Creates a new accessor for the given coordinate reference system.- Parameters:
dim
- the dimension of the temporal component.crs
- the coordinate reference system.
-
-
Method Details
-
of
public static TemporalAccessor of(org.opengis.referencing.crs.CoordinateReferenceSystem crs, int dim) Creates a new temporal accessor for elements at the given dimensions. This method searches for a temporal component in the given CRS.- Parameters:
crs
- the coordinate reference system which may contain a temporal component, ornull
.dim
- offset to add to the dimension indices. This is usually zero.- Returns:
- the temporal accessor, or
null
if no temporal component has been found.
-
getTimeBounds
Returns the lower and upper values in the given envelope. It is caller's responsibility to ensure that the envelope CRS is the same than the one used for creating thisTemporalAccessor
.- Parameters:
envelope
- the envelope from which to get the start time end end time.- Returns:
- the start time and end time in an array of length 1 or 2, or an empty array if none.
-
getTimeRange
Returns the temporal range of given envelope. It is caller's responsibility to ensure that the envelope CRS is the same than the one used for creating thisTemporalAccessor
.- Parameters:
envelope
- the envelope from which to get the start time end end time.- Returns:
- the start time and end time.
- See Also:
-
setTemporalExtent
Copies the temporal extent from an envelope to a metadata object.- Parameters:
envelope
- the source envelope.target
- the target temporal extent.
-