cat_range - ObjectVision/GeoDMS GitHub Wiki
Unit functions cat_range
- cat_range(valuetype*, startvalue, endvalue)
* optional
cat_range(valuetype, startvalue, endvalue) sets the range for a categorical unit with arguments:
- valuetype, the optional value type for the configured unit
- startvalue, the lowest value of the allowed range
- endvalue, the highest value of the allowed range
The cat_range function configures a half open range. This means the value of argument: startvalue is the first value that is part of the range. Argument endvalue is the first value that falls outside the given range.
- It can also be used for two-dimensional domain units, grid domains, with a value type of the pointGroup;
- all arguments can be configured explicitly, but can also be the results of calculations.
- the startvalue argument can be different than the default value of 0.
- literal or parameter valuetype can be any value type.
- literals or parameters startvalue and endvalue of the configured valuetype argument
- uint32 domain unit
unit<uint32> Province := cat_range(uint32, 1, 13)
{
attribute<.> id := id(.);
}
Or shorter:
unit<uint32> Province := cat_range(1, 13)
{
attribute<.> id := id(.);
}
| Province/id |
|---|
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
| 10 |
| 11 |
| 12 |
domain Province, nr of rows = 12
- spoint domain unit
unit<spoint> GridDomain := cat_range(spoint, point(10s, 14s), point(15s, 19s))
{
attribute<.> id := id(.);
}
GridDomain/id, as rendered since GeoDMS 20.14.0 (before that: {10, 14} for the first cell, see XY-order)
| xy(14; 10) | xy(15; 10) | xy(16; 10) | xy(17; 10) | xy(18; 10) |
| xy(14; 11) | xy(15; 11) | xy(16; 11) | xy(17; 11) | xy(18; 11) |
| xy(14; 12) | xy(15; 12) | xy(16; 12) | xy(17; 12) | xy(18; 12) |
| xy(14; 13) | xy(15; 13) | xy(16; 13) | xy(17; 13) | xy(18; 13) |
| xy(14; 14) | xy(15; 14) | xy(16; 14) | xy(17; 14) | xy(18; 14) |
GridDomain, nr of rows = 5, nr of cols = 5