Given a set of points, the AQuadtree class
represents a
varying size Quadtree grid created performing a
bottom-up aggregation considering a minimum threshold for each cell.
Cells with a value under the threshold for the thresholdField
are
aggregated to the upper level in a quadtree manner.
When no thresholdField
is given, total number of points in the cell
will be used, and so, given a threshold of k, none of the cells in the
resulting grid have a value less than k individuals as in a k-anonymity model.
The Quadtree produced balances information loss and accuracy. For instance,
for the set of cells in the left image, where numbers in the cells represent
the values in the thresholdField
, using a threshold
value of 100,
the resulting Quadtree will be the one on the right. As we can see, some cells
will be discarded, and some aggregated to maintain as much information as
possible, keeping at the same time as much disaggregation as possible

The INSPIRE coding system for cell identifiers will be used to generate a
CellCode and CellNum for each cell in the Quadtree.
The objective of the coding system is to generate unique
identifiers for each cell, for any of the resolutions.
The cellCode is a text string, composed of cell size and cell coordinates.
Cell codes start with a cell size prefix. The cell size is denoted in meter (m)
for cell sizes below 1000 m and kilometre (km) for cell sizes from 1000 m and
above.
Example: a 100 meter cell has an identifier starting with “100m”, the
identifier of a 10000 meter cell starts with “10km”.
The coordinate part of the cell code reflects the distance of the lower left
grid cell corner from the false origin of the CRS. In order to reduce the
length of the string, Easting (E) and Northing (N) values are divided by
10^n (n is the number of zeros in the cell size value). Example for a cell
size of 10000 meters: The number of zeros in the cell size value is 4.
The resulting divider for Easting and Northing values is 10^4 = 10000.
The CellNum is a sequence of concatenated integers identifying all the
hierarchical partitions of the main cell in which the point resides.
For instance, the CellNum of the top right cell would be 416 (fourth
in first partition, sixteenth in second partition)
The input object must be projected and units should be in 'meters'
because the system uses the INSPIRE coding system.
function to create an object of class AQuadtree