Index - ObjectVision/GeoDMS GitHub Wiki
Relational functions index
- index(a)
index(a) results in an index attribute based on the sort order of the values in attribute a.
If two values are identical in attribute a, the first occurring value receives the lowest index number.
- attribute a with Numeric, Point, uint2, uint4, bool or string value type
attribute<Region> indexTemp (Region) := index(Temperature);
Temperature | indexTemp |
---|---|
12 | 2 |
11 | 5 |
null | 1 |
11 | 3 |
14 | 0 |
null | 4 |
14 | 6 |
domain Region, nr of rows = 7
attribute<degrees> Temperature_sorted (Region) := Temperature[indexTemp];
Temperature | indexTemp | Temperature_sorted |
---|---|---|
12 | 2 | null |
11 | 5 | null |
null | 1 | 11 |
11 | 3 | 11 |
14 | 0 | 12 |
null | 4 | 14 |
14 | 6 | 14 |
domain Region, nr of rows = 7
unit<uint32> Region: nrofrows = 7
{
attribute<degrees> Temperature :[12,11,null,11,14,null,14];
attribute<.> indexTemp := index(Temperature);
}
unit<uint32> Region_sorted := unique(Region/indexTemp)
{
attribute<float32> Temperature := (Region/Temperature[Region/indexTemp])[values];
}
Values | Temperature |
---|---|
0 | null |
1 | null |
2 | 11 |
3 | 11 |
4 | 12 |
5 | 14 |
9 | 14 |
domain Region_sorted, nr of rows = 7