Class MovingFeatures

java.lang.Object
org.apache.sis.internal.feature.MovingFeatures

public class MovingFeatures extends Object
Utility methods for instantiating features where the geometry is a trajectory and some property values may change with time. This class is not thread-safe.
Since:
0.8
Version:
1.1
Author:
Martin Desruisseaux (Geomatys)
  • Field Details

    • TIME_AS_INSTANTS

      public static final DefaultAttributeType<Instant> TIME_AS_INSTANTS
      Definition of characteristics containing a list of instants, without duplicates. Should be in chronological order, but this is not verified.
  • Constructor Details

    • MovingFeatures

      public MovingFeatures(MovingFeatures share)
      Creates a new builder.
      Parameters:
      share - other builder that may share time vectors, or null if none.
  • Method Details

    • characteristic

      public static DefaultAttributeType<?> characteristic(boolean hasCRS)
      Returns the "datetimes" characteristic to add on an attribute type. The characteristic will expect either Instant or Number values, depending on whether a temporal CRS is available or not.
      Parameters:
      hasCRS - whether a temporal CRS is available.
      Returns:
      the "datetimes" characteristic.
    • setInstants

      public final void setInstants(AbstractAttribute<?> dest, long[] millis)
      Sets the "datetimes" characteristic on the given attribute as a list of Instant instances. Should be in chronological order, but this is not verified.
      Parameters:
      dest - the attribute on which to set time characteristic.
      millis - times in milliseconds since the epoch.
    • setTimes

      public static void setTimes(AbstractAttribute<?> dest, Vector values, DefaultTemporalCRS converter)
      Sets the "datetimes" characteristic on the given attribute. If the converter is non-null, it will be used for converting values to Instant instances. Otherwise values are stored as-is as time elapsed in arbitrary units since an arbitrary epoch.

      Values should be in chronological order, but this is not verified. Current implementation does not cache the values, but this policy may be revisited in a future version.

      Parameters:
      dest - the attribute on which to set time characteristic.
      values - times in arbitrary units since an arbitrary epoch.
      converter - the CRS to use for converting values to Instant instances, or null.