itacart.resolutions.linear_refinement_ratio

itacart.resolutions.linear_refinement_ratio(resolution)[source]

Factor by which the cell side shrinks when refining into resolution.

2 where refinement_ratio() is 4, 5 where it is 25 – the exact integer square root, since the cell is a parallelogram whose base and height are equal and both divide by the same factor.

Coordinate descent uses this one; child enumeration uses refinement_ratio(). Table 1 states both, in different columns, and confusing them produces a wrong cell in silence rather than an exception, which is the most expensive failure mode in this package which is the linear ratio and not the area one.

Called subdivisions_per_axis in itacart_core/resolutions.py. That version returns 1 at resolution 1, treating the base grid as an anchor; this one raises instead. A descent loop that reads 1 for resolution 1 divides the side by one and silently produces a cell at the wrong level, which is the same failure mode the area/linear split exists to prevent.

Parameters:

resolution (int) – Target resolution level, 2 to 13.

Return type:

int

Returns:

2 for even resolutions, 5 for odd ones.

Raises:

ResolutionError – If resolution is below 2 or above 13.