Sets the desired maximum number of cells in the approximation. Note
the following:
- For any setting of max_cells(), up to 6 cells may be returned if
that is the minimum number required (e.g. if the region intersects
all six cube faces). Even for very tiny regions, up to 3 cells may
be returned if they happen to be located at the intersection of
three cube faces.
- min_level() takes priority over max_cells(), i.e. cells below the
given level will never be used even if this causes a large number of
cells to be returned.
- If max_cells() is less than 4, the area of the covering may be
arbitrarily large compared to the area of the original region even
if the region is convex (e.g. an S2Cap or S2LatLngRect).
Accuracy is measured by dividing the area of the covering by the area
of the original region. The following table shows the median and worst
case values for this area ratio on a test case consisting of 100,000
spherical caps of random size (generated using s2region_coverer_test):
Sets the desired maximum number of cells in the approximation. Note the following:
- For any setting of max_cells(), up to 6 cells may be returned if that is the minimum number required (e.g. if the region intersects all six cube faces). Even for very tiny regions, up to 3 cells may be returned if they happen to be located at the intersection of three cube faces.
- min_level() takes priority over max_cells(), i.e. cells below the given level will never be used even if this causes a large number of cells to be returned.
- If max_cells() is less than 4, the area of the covering may be arbitrarily large compared to the area of the original region even if the region is convex (e.g. an S2Cap or S2LatLngRect).
Accuracy is measured by dividing the area of the covering by the area of the original region. The following table shows the median and worst case values for this area ratio on a test case consisting of 100,000 spherical caps of random size (generated using s2region_coverer_test):
The default value of 8 gives a reasonable tradeoff between the number of cells used and the accuracy of the approximation.
DEFAULT: DEFAULT_MAX_CELLS