Range

Unit functions range

syntax

  • range(unit, startvalue, endvalue)

definition

range(unit, startvalue, endvalue) sets the range for a unit with arguments:

  • unit, a Base unit or Projection for the range. If no base unit or projection is needed, you can configure a default unit (like uint32 for integers)
  • startvalue, the lowest value of the allowed range
  • endvalue, the highest value of the allowed range

The Value type for the configured Unit is derived from the start- and endvalue.

The 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.

description

The number of entries/elements of a Domain unit can be configured with this range function or with the NrofRows Property. The range function is more flexible as:

  • 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.

range property

Next to the range function there is a range Property, which sets the same half open range from a string:

unit<uint32> Province: range = "[1, 13)";

The range function is to be preferred in new configurations: its arguments can be the result of a calculation, whereas the property takes a literal string. The property is what GeoDMS itself writes when it records a calculated unit range, for instance in the 0Dictionary.dms of an MMD storage.

For a two-dimensional unit each bound is a point. Since GeoDMS 20.14.0 those points are tagged, so the coordinate order is stated rather than assumed:

unit<fpoint> rdc_meter: range = "[xy(0; 300000), xy(280000; 625000))";

yx(y; x) is accepted as well, and so is the legacy untagged {first, second}, which always meant {row, col}. See XY order for the full description.

applies to

  • literal or Parameter valuetype can be any value type.
  • literals or parameters startvalue and endvalue with the same valuetype.

example

  1. uint32 domain unit
unit<uint32> Province := range(uint32, 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

  1. spoint domain unit
unit<spoint> GridDomain := 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

see also