Class TemporalAccessor

java.lang.Object
org.apache.sis.internal.referencing.TemporalAccessor

public final class TemporalAccessor extends Object
Convenience methods for accessing the temporal component of an object (envelope, grid geometry…).
Since:
1.0
Version:
1.1
Author:
Martin Desruisseaux (Geomatys)
  • Field Details

    • EMPTY

      public static final Instant[] EMPTY
      Empty array of instants.
    • dimension

      public final int dimension
      Dimension of the temporal component.
    • timeCRS

      public final DefaultTemporalCRS 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, or null.
      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

      public Instant[] getTimeBounds(AbstractEnvelope envelope)
      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 this TemporalAccessor.
      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

      public Range<Instant> getTimeRange(org.opengis.geometry.Envelope envelope)
      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 this TemporalAccessor.
      Parameters:
      envelope - the envelope from which to get the start time end end time.
      Returns:
      the start time and end time.
      See Also: