ClassifyNonzeroEqualCount
Classify functions ClassifyNonzeroEqualCount
syntax
- ClassifyNonzeroEqualCount(a, domain_unit)
- ClassifyNonzeroEqualCount(values, count, Domain unit)
| Since GeoDMS 20.20.0 the second form classifies a value-count table that was calculated before, with values and count the two [[subitem | sub items]] of a weeded_counts result. Use it when more than one result is derived from the same scan of a, since the calculation cache then calculates that scan once; the GeoDMS GUI uses this form of ClassifyNonzeroJenksFisher for the classification it generates for a map layer without a configured Classification. Below 4096 distinct values it gives the same class breaks as the two argument form; above it they can differ, because weeded_counts merges values that the two argument form counts separately. |
definition
ClassifyNonzeroEqualCount(a, domain unit) results in a Data item with class breaks based on an equal count distribution of classes, as ClassifyEqualCount does, but treats the value 0 as a special value, as ClassifyNonzeroJenksFisher does (since 20.23.1):
- 0 is a compulsory class break, and the class that starts at 0 contains only the zeros.
- The negative and the positive values are classified separately, each with an equal count distribution over its own values.
- The numbers of classes for the negative and the positive values, within the total number of classes, are chosen such that the largest average count of a class is as small as possible. On a tie, the positive values get the extra class.
With 2 classes and data that contain negative values, the value 0 and positive values, there is no room for a class of 0 alone: the class breaks are the minimum and 0, so the negative values form the first class, and 0 shares the second class with the positive values.
Data with negative and positive values but without the value 0 also get a class break at 0 when there are 3 or more classes. The class that starts at 0 then contains no values, so that a diverging palette is centred on 0.
With only positive or only negative values, with 1 class, or with no more distinct values than classes, the class breaks are those of ClassifyEqualCount.
description
The same function can also be applied from the GUI, by requesting the Palette Editor of a map layer and activating the Classify > Equal Counts non-zero classification (since 20.23.1).
The ClassifyNonzeroEqualCount results in a set of ClassBreaks that can be used in the Classify function to classify a data item.
example
attribute<nrPersons> classifyNZEcNrInh (inh_4K) := ClassifyNonzeroEqualCount(NrInh, inh_4K);
| classifyNZEcNrInh |
|---|
| 0 |
| 2 |
| 200 |
| 750 |
Table inh_4K, nr of rows = 4
| NrInh |
|---|
| 550 |
| 1025 |
| 300 |
| 200 |
| 0 |
| null |
| 300 |
| 2 |
| 20 |
| 55 |
| 860 |
| 1025 |
| 1025 |
| 100 |
| 750 |
Table District, nr of rows = 15
The value 0 gets a class of its own, and the 13 positive values are divided over the other 3 classes with counts as equal as possible. On the same data, ClassifyEqualCount gives the class breaks 0, 55, 300 and 860.