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
- Author:
- Martin Desruisseaux (Geomatys)
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal intDimension of the temporal component.static final Instant[]Empty array of instants.final DefaultTemporalCRSConverter from floating point numbers to dates. -
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 TemporalAccessorof(org.opengis.referencing.crs.CoordinateReferenceSystem crs, int dim) Creates a new temporal accessor for elements at the given dimensions.
-
Field Details
-
EMPTY
Empty array of instants. -
dimension
public final int dimensionDimension of the temporal component. -
timeCRS
Converter from floating point numbers to dates.
-
-
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
nullif 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:
-