ENCODER->


encoder conversion gts
Since v1.2.9
Available on all platforms
See also

The ENCODER-> functions convert an encoder into a list of ( timestamp, latitude, longitude, elevation, value ) list. It also pushes attributes, labels and name on the stack. Function also accepts wrapped or raw-wrapped encoders or gts.

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) where a GTS is limited to the type of the first value stored. An encoder can also have a name, labels and attributes.

The set of operations which can be performed on encoders is more limited than those that can be performed on GTS.

Signature

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 { 'label1' 'idxxx' } RELABEL { 'myAttribute' '42' 'AnOtherAttribute' 'foo' } SETATTRIBUTES //WRAPRAW //push a byte array on the stack. WRAP pushes a string. ENCODER->
NEWGTS 'testname' RENAME { 'label1' 'idxxx' } RELABEL { 'myAttribute' '42' 'AnOtherAttribute' 'foo' } SETATTRIBUTES 100 NaN NaN NaN true ADDVALUE //timestamp, value 110 NaN 45 NaN true ADDVALUE //timestamp, value 120 1.2 NaN 250 true ADDVALUE //timestamp, elevation, value 130 48.44218 -4.41427 80000 true ADDVALUE //timestamp, latitude, longitude, elevation, value WRAP //or WRAPRAW... ENCODER->