Skip to content

weeded_counts

MaartenHilferink edited this page Sep 8, 2026 · 1 revision

Classify functions weeded_counts

syntax

  • weeded_counts(a)

definition

weeded_counts(a) results in a new domain unit with one entry per distinct value of data item a, in ascending order, with two subitem:

  • Values: the distinct values, with the values unit of a
  • Count: how often each occurs, as uint64

Null values are not counted. The number of entries is capped at 4096: above that, adjacent values are merged into one entry whose count is their total, so the result stays a summary of the distribution rather than a full frequency table.

description

This is the value-count table that every Classify functions function calculates internally. Requesting it as a data item of its own is useful when more than one result is derived from the same scan, since the calculation cache then computes it once. The GeoDMS GUI uses it for the classification it generates for a map layer that has no configured Classification: the number of distinct values determines how many classes the legend gets, and the class breaks are calculated from the same table.

Each of the classify functions has a three argument form that takes such a table instead of the data item, see ClassifyJenksFisher and its siblings on Classify functions.

Below 4096 distinct values the two forms of a classify function give the same class breaks. Above it they can differ, because weeded_counts has merged values that the two argument form counts separately.

applies to

since version

20.20.0

example

unit<uint32> district_counts := weeded_counts(District/NrInh);

unit<uint8>       classes     : nrofrows = 4;
attribute<nrPersons> breaks (classes) :=
    ClassifyNonzeroJenksFisher(district_counts/Values, district_counts/Count, classes);
district_counts/Values district_counts/Count
0 1
2 1
20 1
55 1
100 1
200 1
300 2
550 1
750 1
860 1
1025 3

Table district_counts, nr of rows = 11, calculated from the 15 rows of table District, one of which is null

see also

Clone this wiki locally