itacart.boundary

Boundary behaviour: prime meridian, antemeridian, extension zones.

This module is what makes the domain global, complete and unique, and so carries OGC DGGS Core requirements 8, 9 and 10 on its own.

Three departures from the uniform parallelogram grid are specified in section 3.2 of the paper:

Prime meridian. Cells straddling 0 degrees are isosceles triangles whose base is twice their height, mirrored about the meridian. This applies at resolution 1; finer resolutions subdivide the adjacent eastern cells rather than creating separate western ones. Consequently resolution-1 cells with X = 0 in the western quadrants do not exist.

Antemeridian. Uniform areas cannot be held everywhere at 180 degrees, so the eastern quadrants are extended over the inhabited landmasses that the meridian crosses: Fiji and the Chukotka/Wrangel group. Antarctica is excluded. Cells in the oceans and in Antarctica along that boundary therefore have unequal areas.

Trapezoids. Where a parallelogram vertex on the side opposite the prime meridian would cross a boundary line, that side is clipped to the line, extending the longer base into a trapezoid. The rule applies only to the cells in that condition, not to their subdivisions.

The model

Every cell has a nominal ring on the parallels plane – a parallelogram in the ordinary case, an isosceles triangle in the prime-meridian column – and an effective ring, which is the nominal one clipped to its quadrant’s domain. An eastern quadrant is bounded by the meridian its extension reaches: 180 degrees outside a zone, 182 or 190.5 degrees inside one. A western quadrant is bounded by the same line seen from the other side, so it gives up exactly what the eastern one gains. Both are bounded by the pole as well.

Clipping is the single mechanism. A cell exists when its clipped ring still has area; it is a trapezoid when the clip changed the ring; it honours the nominal area when the clip left it alone. Every predicate here is a reading of that one construction.

Triangle refinement

The children of a meridian triangle are triangles, at every resolution. Figure 4(c) labels all 25 children of one triangle, and the arrangement it draws is the ordinary grid folded onto itself about its diagonal: child (row i, column j) sits in triangle row min(i, j), at |i - j| steps east of the meridian when j >= i and the same number of steps west when j < i. The diagonal children – A1, B2, C3, D4, E5 – straddle the meridian and are themselves isosceles triangles with base twice height, so the construction is closed under refinement and no western cell is ever created.

Module constants

ZONE_ROWS

Resolution-1 row span each zone is realized on, inclusive.

Functions

absorbs_border

Whether a cell's outer side has been carried onto the domain border.

cell_shape

Geometric class of a cell.

child_code

Refinement code of a child at one row and column.

child_position

Row and column of a refinement code inside its parent, zero-based.

crosses_antemeridian

Whether a geometry spans the 180th meridian.

extension_bounds

Geodetic bounds of an extension zone.

extension_zone

Which extension zone contains a cell, if any.

extension_zone_for_point

Which extension zone contains a geodetic position, if any.

is_boundary_cell

Whether a cell touches any grid discontinuity.

is_equal_area_cell

Whether a cell honours the nominal area of its resolution.

is_extension_cell

Whether a cell lies inside an eastern-quadrant extension.

is_trapezoidal_cell

Whether a cell has been clipped at a boundary line.

is_triangular_cell

Whether a cell is a prime-meridian isosceles triangle.

is_valid_cell

Whether a cell exists in the ITACaRT domain.

last_lattice_column

Greatest column of a square lattice row that exists inside the border.

meridian_child

Sub-row and signed offset of a child inside a prime-meridian triangle.

meridian_child_grid

Grid row and column of a child.

meridian_geometry

Descend the prime-meridian column of one atomic index.

plane_ring

Effective plane ring of one atomic cell, and the shape it takes.

ring_area

Unsigned area of a plane ring, in square metres.

ring_centroid

Area centroid of a plane ring, in metres.

to_geodetic

Invert a plane vertex, answering the pole itself at the quadrant.