itacart.engine.ITACaRT
- class itacart.engine.ITACaRT(default_resolution=13, edge_model='WGS84_GEODESIC', max_segment_m=DEFAULT_MAX_SEGMENT_M)[source]
Bases:
objectStateful facade over the ITACaRT reference system.
Wraps the functional API so a caller can fix defaults once and reuse them, and provides the descriptive metadata the OGC model asks for.
- Parameters:
- Raises:
ResolutionError – If
default_resolutionis outside the table.ValueError – If
edge_modelis not an edge type ITACaRT defines, ormax_segment_mis not positive.
- EDGE_MODELS = ('WGS84_GEODESIC', 'WGS84_SMALL_CIRCLE')
Edge types this reference system declares, in the vocabulary of clause 9.1.4.2 of the standard. ITACaRT states two: its cell edges are geodesics on the WGS84 ellipsoid, and the rows and the polar cap close on small circles of constant latitude.
- describe()[source]
Machine-readable description of the reference system.
Covers identity and DOI, the CRS and datum, the tessellation method, cell geometry, the full resolution table, refinement ratios, and the boundary treatments. Shaped to feed an OGC API-DGGS
/dggs/{dggrsId}response.The content is read from the package rather than restated: the resolution table comes from
itacart.resolution_table(), which transcribes Table 1 of the paper, and the ellipsoid fromitacart.constants, which transcribes section 3. Anything here that duplicated a value instead of reading it would be a second place for that value to be wrong.constraintscarriescellEqualSized, which Requirement 21 asks the reference system to declare, alongside the exception that makes the declaration honest.
- crs()[source]
The coordinate reference system this grid is defined on.
Reports WGS84 as the datum, satisfying requirement 7 and the GNSS-compatibility design criterion, alongside the ellipsoidal sinusoidal projection used internally.
The ellipsoid parameters are read from
itacart.constants, which transcribes section 3 of the paper and derives everything from the two defining parameters rather than transcribing decimals.
- conformance()[source]
Self-reported conformance against DGGS Core and EAERS.
Reports one record per requirement of OGC 20-040r3, each with its URI, a boolean verdict, a coverage description and a justification.
The verdict is boolean because the requirements are written with shall, which admits no middle answer: a requirement that holds for every cell but three is not met. Coverage is reported beside it and never instead of it, because the size of an exception is information a consumer needs and is not a softening of the verdict. Where a requirement is not met, the justification names what diverges and, wherever the package has measured it, by how much and over how many cells.
Three things this deliberately does not do. It does not repeat the paper’s grouping of Requirements 22 to 25 under one heading and one verdict: the figures of the standard put a polyhedron in the path of all four, but the normative text puts it in the path of only the first, and the other three are met. It does not write any limitation of an algorithm as a property of the grid: where a refusal belongs to an operation rather than to the tessellation, the record says which. And it does not answer a requirement about the figure on the surface of the Earth by measuring the chart the package happens to draw it in, which is how the polar caps were once read out of Requirements 11 and 26 that they in fact meet.
- cell_to_centroid(cell)[source]
Geodetic centroid of a cell.
See
itacart.cells.cell_to_centroid().- Raises:
NonAtomicIndexError – If the index names more than one cell. The functional API answers a compositional index with a positionally aligned list; this signature promises one answer, and returning the first of several would be wrong in a way the type checker endorses. The refusal uses the package’s own exception rather than a bare one, because
are_neighbor_cellsandgrid_distancerefuse the identical argument shape with this exception and a caller should not have to know which of the three it called.- Parameters:
cell (str)
- Return type:
- NonExistentCellError: If any cell of the index names no cell.
The predicate is the arbiter and the contract ends there: a spelling it denies is refused rather than answered for the cell it would otherwise fold onto.
- cell_to_boundary(cell)[source]
Geodetic vertices bounding a cell.
See
itacart.cells.cell_to_boundary().- Raises:
NonAtomicIndexError – If the index names more than one cell, for the reason given on
cell_to_centroid().- Parameters:
cell (str)
- Return type:
- NonExistentCellError: If any cell of the index names no cell.
The predicate is the arbiter and the contract ends there: a spelling it denies is refused rather than answered for the cell it would otherwise fold onto.