-
Notifications
You must be signed in to change notification settings - Fork 1
Diversity
Grid functions diversity
- diversity(grid_data_item, radius, square_or_circle)
diversity(grid_data_item, radius, square_or_circle) results in a new attribute with the number of different occurences in the neighbourhood of each cell of the grid_data_item.
The argument radius defines the neighbourhood size, in number of cells.
The argument square_or_circle indicates if a square (value 0) or a circle (value 1) is used to define the shape of the neighbourhood.
The resulting item has the same domain unit as the grid_data_item and a uint8 or unit32 value type (based on the value type of the grid_data_item).
- attribute grid_data_item with uint8 or uint32 value type
- parameter or literal radius with uint16 value type
- parameter or literal square_or_circle with uint16 value type
The domain unit of the grid_data_item argument must be a Point value type of the group CanBeDomainUnit.
attribute<uint32> divgrid (GridDomain) := diversity(sourcegrid, 2w, 1w);
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 |
GridDomain, nr of rows = 5, nr of cols = 5
divgrid
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 |
GridDomain, nr of rows = 5, nr of cols = 5
GeoDMS ©Object Vision BV. Source code distributed under GNU GPL-3. Documentation distributed under CC BY-SA 4.0.