Loading

->GTS

gts encoder conversion multivariate

The ->GTS function converts an encoder into one GTS per type in the encoder. The result is a map, with key describing the type. If defined, name, labels and attributes are kept in the result. Function also accepts wrapped or raw-wrapped encoders.

Since 2.4.0:
  • ->GTS function can also take a conversion MAP input. Using this conversion MAP, the output is always a list of GTS.
  • The conversion map can also take a list of selectors for each output type.
  • The conversion map can be empty: In this case, the GTS type is enforced by the type of the first element in the encoder input.
  • The first selector match stops the research. It means key order matters. See Examples.
  • A new '.type' label is added to each output GTS. This could be overridden with the 'label.type' parameter of the conversion MAP.
  • ->GTS function can handle encoders, or list of encoders.
What is an encoder ?

A Geo Time Series™ is limited to the type of the first value stored. An encoder is very similar to a Geo Time Series™, it differs by its ability to store values of all four types (LONG, DOUBLE, BOOLEAN, STRING) and since 2.1 also BINARY content. The set of operations which can be performed on encoders is more limited than those that can be performed on GTS.

->GTS is available since version 1.2.9.

See also

Signatures

Examples

[ [ 1 48.44218 -4.41427 80000 "v1" ] // ( timestamp, latitude, longitude, elevation, string value ) [ 2 12 3.14 ] // ( timestamp, elevation, double value ) [ 3 42 ] // ( timestamp, long value ) [ 4 -45 0 true ] // (timestamp, lat, long, boolean value) ] ->ENCODER "testname" RENAME { 'id' '23444' } RELABEL ->GTS //MAP-> //if you want to visualize the GTS
[ [ 1 48.44218 -4.41427 80000 "v1" ] // ( timestamp, latitude, longitude, elevation, string value ) [ 2 12 3.14 ] // ( timestamp, elevation, double value ) [ 3 42 ] // ( timestamp, long value ) [ 4 -45 0 true ] // (timestamp, lat, long, boolean value) ] ->ENCODER WRAPRAW //push a byte array on the stack. WRAP pushes a string. ->GTS
// the order of the map do matter [ NEWENCODER 'foo' RENAME 0 NaN NaN NaN 3.14 ADDVALUE NEWENCODER 'foobar' RENAME 0 NaN NaN NaN 3.14 ADDVALUE ] { 'LONG' 'foo{}' 'DOUBLE' '~.*{}' 'label.type' NULL // remove the extra .type label in the output } ->GTS