...
To work with temporal attributes, you need to have some in your stream. There are multiple ways to create temporal attributes. You can use the existing aggreagtion functions which "learn" a function from the previous elements. These create linear or spline functions and prdict, i.e. extrapolate or interpolate unknown points in time.
For example, you can create a temporal double from a stream of double values. "wh" is an attribute with a double value. In this case, there are "wh" measurements from different sources, which can be grouped by their "id". The eval_at_outdating is not necessary. It reduces the number of output elements of the aggregation operator and can be handy in some cases, but problematic in others.
Code Block |
---|
/// Convert the wh-attribute to a temporal double
temporalize = AGGREGATION({
aggregations = [['function' = 'ToTemporalDouble', 'input_attributes' = 'wh', 'output_attributes' = 'temp_wh']],
group_by = ['id'],
eval_at_outdating = false
},time) |
Text
) |
Another possibility is to crate a temporal spatial point with a spline or a linear function:
Code Block |
---|
/// Temporalize the location attribute temporalize = AGGREGATION({ aggregations = [['function' = 'TOLINEARTEMPORALPOINT', 'input_attributes' = 'SpatialPoint', 'output_attributes' = 'temp_SpatialPoint']], group_by = ['id'], eval_at_outdating = false }, createSpatialObject) |
Text
}, createSpatialObject) |
Another option is that you already know the future movement or at least some points. An example function which uses this mechanism is the "FromTemporalGeoJson" map function. It creates a temporal function from the given source. This can be an option, if you know the future values, e.g., because your navigation systems provides a route.
Code Block |
---|
/// A known trajectory input_traj = ACCESS({ source='Source', wrapper='GenericPull', transport='File', protocol='Text', datahandler='Tuple', metaattribute = ['TimeInterval', 'PredictionTimes'], options=[ ['filename', '/home/tobi/dev/odysseus_workspace/phd-workspace/Moving Object/Basic Queries/predefinedTrajectory/temporalGeoJson.txt'], ['Delimiter', ';'] ], schema=[['data', 'String']] }) json = MAP({ expressions = [['FromTemporalGeoJson(data)','tempTrajectory']] },input_traj) |
The schema of the temporal GeoJson is copied from the Leaflet library, because there is no common standard for temporal GeoJson: https://github.com/socib/Leaflet.TimeDimension#ltimedimensionlayergeojson
...