district
- Details
- Last Updated on Monday, 28 January 2013 21:25
syntax
- district(sourcegrid)
definition
district(sourcegrid) results in a new uint32 domain unit. A district is a set of adjacent (horizontal & vertical, not diagonal) grid cell values with the same index number. The index numbers are based on the distribution of the values in the original attribute. If two adjacent cells have the same value in this attribute, they will be part of the same district. For the new unit, a subitem Districts is generated. This subitem has the same domain unit as the sourcegrid attribute and as values unit, the index numbersr for each district (zero based).
description
In earlier versions of the GeoDMS adjacency was also defined in diagonal directions.
applies to
Attribute sourcegrid with value types:
- uint8
- uint32
conditions
The domain unit of the sourcegrid attribute needs to be of the value type PointGroup and CanBeDomainUnit.
since version
5.15
example
unit<uint32> unit_district: expr = "district(sourcegrid)";
| sourcegrid | ||||
| null | 0 | 0 | 0 | 1 |
| 0 | 0 | 2 | 1 | 1 |
| 0 | 2 | 3 | 3 | 3 |
| 1 | 1 | 1 | 3 | 0 |
| 0 | 1 | 0 | 1 | 3 |
| unit_district/Districts | ||||
| null | 0 | 0 | 0 | 1 |
| 0 | 0 | 2 | 1 | 1 |
| 0 | 3 | 4 | 4 | 4 |
| 5 | 5 | 5 | 4 | 6 |
| 7 | 5 | 8 | 9 | 10 |