S2CellIdSnapFunction.levelForMaxSnapRadius

Returns the minimum S2Cell level (i.e., largest S2Cells) such that vertices will not move by more than "snap_radius". This can be useful when choosing an appropriate level to snap to. The return value is always a valid level (out of range values are silently clamped).

If you want to choose the snap level based on a distance, and then use the minimum possible snap radius for the chosen level, do this:

S2CellIdSnapFunction f( S2CellIdSnapFunction::LevelForMaxSnapRadius(distance));

class S2CellIdSnapFunction
static
int
levelForMaxSnapRadius

Meta