Loading

METASORT

gts

Sorts a list of Geo Time Series™ according to elements of their metadata. The list of elements to consider for sorting can contain label/attribute names or NULL to consider the classname. Elements will be considered in the order in which they appear in the list. If two GTSs match the same criteria, the order considered is the one given in the list of Geo Time Series™.

If the list of elements is empty, the sort will apply on class name then on label and last on attributes.

When sorting on a label/attribute, if 2 GTS match the same criterion, the one with the smallest number of labels is the first. When sorting on a label/attribute, the GTS who does not have the label will be considered first.

METASORT is available since version 1.0.0.

See also

Signatures

Examples

NEWGTS 'aaa' RENAME { 'label1' 'b' 'label2' 'a' } RELABEL NEWGTS 'bbb' RENAME { 'label1' 'a' 'label2' 'b' } RELABEL NEWGTS 'ccc' RENAME 3 ->LIST [ 'label1' ] METASORT
NEWGTS 'aaa' RENAME { 'label1' 'b' 'label2' 'a' } RELABEL NEWGTS 'bbb' RENAME { 'label1' 'a' 'label2' 'b' } RELABEL NEWGTS 'ccc' RENAME 3 ->LIST [ NULL 'label1' ] METASORT

Examples

gtsA = NEWGTS() RENAME(gtsA, 'aaa') RELABEL(gtsA, { 'label1':'b', 'label2':'a' }) gtsB = NEWGTS() RENAME(gtsB, 'bbb') RELABEL(gtsB, { 'label1':'a', 'label2':'b' }) gtsC = NEWGTS() RENAME(gtsC, 'ccc') return METASORT( [ gtsA, gtsB, gtsC ], [ 'label1' ])
gtsA = NEWGTS() RENAME(gtsA, 'aaa') RELABEL(gtsA, { 'label1':'b', 'label2':'a' }) gtsB = NEWGTS() RENAME(gtsB, 'bbb') RELABEL(gtsB, { 'label1':'a', 'label2':'b' }) gtsC = NEWGTS() RENAME(gtsC, 'ccc') return METASORT( [ gtsA, gtsB, gtsC ], [ NULL(), 'label1' ])