Package org.apache.sis.internal.feature
Class MovingFeatures
java.lang.Object
org.apache.sis.internal.feature.MovingFeatures
- Direct Known Subclasses:
MovingFeatureBuilder
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<Vector,
InstantList> Caches of list of times or instants, used for sharing existing instances.static final DefaultAttributeType<Instant>
Definition of characteristics containing a list of instants, without duplicates.private static final DefaultAttributeType<Number>
An alternative toTIME_AS_INSTANTS
used when times cannot be mapped to calendar dates. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultAttributeType<?>
characteristic
(boolean hasCRS) Returns the "datetimes" characteristic to add on an attribute type.final void
setInstants
(AbstractAttribute<?> dest, long[] millis) Sets the "datetimes" characteristic on the given attribute as a list ofInstant
instances.static void
setTimes
(AbstractAttribute<?> dest, Vector values, DefaultTemporalCRS converter) Sets the "datetimes" characteristic on the given attribute.
-
Field Details
-
TIME_AS_INSTANTS
Definition of characteristics containing a list of instants, without duplicates. Should be in chronological order, but this is not verified. -
TIME_AS_NUMBERS
An alternative toTIME_AS_INSTANTS
used when times cannot be mapped to calendar dates. This characteristic uses the same name thanTIME_AS_INSTANTS
. Consequently, at most one ofTIME_AS_INSTANTS
andTIME_AS_NUMBERS
can be used on the same property. -
cache
Caches of list of times or instants, used for sharing existing instances. We do this sharing because it is common to have many properties having the same time characteristics.
-
-
Constructor Details
-
MovingFeatures
Creates a new builder.- Parameters:
share
- other builder that may share time vectors, ornull
if none.
-
-
Method Details
-
characteristic
Returns the "datetimes" characteristic to add on an attribute type. The characteristic will expect eitherInstant
orNumber
values, depending on whether a temporal CRS is available or not.- Parameters:
hasCRS
- whether a temporal CRS is available.- Returns:
- the "datetimes" characteristic.
-
setInstants
Sets the "datetimes" characteristic on the given attribute as a list ofInstant
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
Sets the "datetimes" characteristic on the given attribute. If theconverter
is non-null, it will be used for converting values toInstant
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 toInstant
instances, ornull
.
-