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 |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
– (see |
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
Base and height of a cell, in metres. |
|
True area of a specific cell, accounting for boundary clipping. |
|
Return the resolution level of a cell index. |
|
Whether cells at this resolution carry a whole-number metric area. |
|
Factor by which the cell side shrinks when refining into |
|
Area of a standard parallelogram cell, in square metres. |
|
Number of children produced when refining into |
|
Resolution adequate for a target cartographic scale. |
|
Full Table 1 of the paper as structured records. |
|
Cartographic scale denominator matching a resolution. |