itacart.geometry.vertex_to_cell

itacart.geometry.vertex_to_cell(geometry, resolution, dedupe_consecutive=True)[source]

Map geometry vertices to cells, preserving sequence.

Order is topological, not sorted: it is what allows the original geometry to be reconstructed. Rings keep their winding, and holes follow the exterior.

Consecutive vertices landing in the same cell are collapsed by default, since at resolution 13 that reflects survey precision rather than distinct corners. Non-consecutive repeats are kept, being a genuine self-touching pathology the caller should see.

A ring is treated as cyclic for the purposes of collapsing, so a ring whose last vertex falls in the same cell as its first loses the last one rather than closing on a duplicate. A LINESTRING is not cyclic and keeps both ends even when they coincide.

The cell is the precision. A vertex written as a cell says how well it is known – within its cell at the resolution chosen – which a coordinate cannot say: section 3.1.10 of RFC 7946 rules out reading uncertainty from the number of digits. cells_to_geometry() is the inverse, and its docstring states what a rebuilt vertex promises.

Provenance: cadastral_processor/vertex_extractor.py.

Parameters:
  • geometry (Point | LineString | Polygon) – A Shapely geometry in EPSG:4326.

  • resolution (int) – Target resolution level, 1 to 13.

  • dedupe_consecutive (bool, default: True) – Collapse consecutive duplicates.

Return type:

list[str]

Returns:

Atomic index strings in traversal order, one per vertex kept, each the cell itacart.cells.geo_to_cell() answers for it. So a vertex inside the cell that holds a pole at resolution 10 can come back, at resolutions 11 and 12, as a spelling that names no cell, which itacart.boundary.is_valid_cell() denies: a known limitation, stated in itacart.cells.

Raises:

UnsupportedGeometryTypeError – On unsupported geometry types.