itacart.resolutions

Resolution table helpers.

Satisfies OGC DGGS Core requirements 14 and 15 (hierarchical grid sequence).

Provenance: itacart_core/resolutions.py and Table 1 of the paper.

Correspondence with the origin, which stores sides as exact integer centimetres and derives everything from them:

itacart_core/resolutions.py

this module

base_length_m

cell_size()

cell_area_m2

nominal_cell_area()

children_per_cell

refinement_ratio()

subdivisions_per_axis

linear_refinement_ratio()

is_tokenizable_resolution

is_tokenizable_resolution()

is_even_resolution

– (see constants.refinement_alphabet)

Values agree with the origin exactly, to zero ulps, on all 13 metric rows for side, area and both ratios. The one divergence is resolution 1 under is_tokenizable_resolution(), a reading of the paper that function explains.

The module is a typed, validating facade over the tuples in itacart.constants. It restates no value from Table 1: every figure returned here is read from a constant audited against the paper, so a wrong row can only be wrong in one place.

Two distinctions in this module are load-bearing and easy to get wrong.

Area ratio against linear ratio. refinement_ratio() reports how many children a refinement produces – 4 or 25. The side of the child is half or a fifth of the parent’s, never a quarter or a twenty-fifth. The descent in itacart.cells needs the linear factor and child enumeration needs the area factor, and substituting one for the other yields a wrong cell with no exception raised. linear_refinement_ratio() exists so neither has to be spelled inline.

Nominal area against effective area. nominal_cell_area() takes a resolution and effective_cell_area() takes a cell. The differing signatures are deliberate: a caller cannot reach for the cheaper one without noticing that it never saw the cell.

Functions

cell_size

Base and height of a cell, in metres.

effective_cell_area

True area of a specific cell, accounting for boundary clipping.

get_resolution

Return the resolution level of a cell index.

is_tokenizable_resolution

Whether cells at this resolution carry a whole-number metric area.

linear_refinement_ratio

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

nominal_cell_area

Area of a standard parallelogram cell, in square metres.

refinement_ratio

Number of children produced when refining into resolution.

resolution_for_scale

Resolution adequate for a target cartographic scale.

resolution_table

Full Table 1 of the paper as structured records.

scale_for_resolution

Cartographic scale denominator matching a resolution.