The dimension of the metric
The "deriv" value of a metric is a derivative, and must be multiplied by a length or area in (s,t)-space to get a useful value.
The "deriv" value of a metric is a derivative, and must be multiplied by a length or area in (s,t)-space to get a useful value.
The dimension of the metric
Return the level at which the metric has approximately the given value. For example, K_AVG_EDGE.getClosestLevel(0.1) returns the level at which the average cell edge length is approximately 0.1. The return value is
The value at which to compute the level
Return the minimum level such that the metric is at most the given value, or S2CellId::kMaxLevel if there is no such level. For example, K_MAX_DIAG.getLevelForMaxValue(0.1) returns the minimum level such that all cell diagonal lengths are 0.1 or smaller. The return value is always a valid level.
The value at which to compute the level
Return the maximum level such that the metric is at least the given value, or 0 if there is no such level. For example, K_MAX_DIAG.getLevelForMinValue(0.1) returns the maximum level such that all cells have a minimum width of 0.1 or larger. The return value is always a valid level.
The value at which to compute the level
Return the value of a metric for cells at the given level. The value is either a length or an area on the unit sphere, depending on the particular metric.
The level at which to compute the metric
The value of the metric
The following are various constants that describe the shapes and sizes of S2Cells (see s2coords.h and s2cell_id.h). They are useful for deciding which cell level to use in order to satisfy a given condition (e.g. that cell vertices must be no further than "x" apart). All of the raw constants are differential quantities; you can use the getValue(level) method to compute the corresponding length or area on the unit sphere for cells at a given level. The minimum and maximum bounds are valid for cells at all levels, but they may be somewhat conservative for very large cells (e.g. face cells).
All of the values below were obtained by a combination of hand analysis and Mathematica. In general, S2_TAN_PROJECTION produces the most uniform shapes and sizes of cells, S2_LINEAR_PROJECTION is considerably worse, and S2_QUADRATIC_PROJECTION is somewhere in between (but generally closer to the tangent projection than the linear one).
Note that S2_LINEAR_PROJECTION can be useful for analysis even when another projection is being used, since it allows many cell metrics to be bounded in terms of (u,v) coordinates rather than (s,t) coordinates. (With the linear projection, u = 2 * s - 1 and similarly for v.) Similarly, S2_TAN_PROJECTION allows cell metrics to be bounded in terms of (u,v) coordinate changes when they are measured as distances on the unit sphere.
Defines a cell metric of the given dimension (1 == length, 2 == area).