vibespatial.constructive.normalize

GPU-accelerated geometry normalization.

Canonicalizes geometries by: - Rotating polygon rings to the lexicographically smallest cyclic coordinate order - Reversing linestrings so the smaller endpoint comes first - Sorting multi-geometry parts by their first vertex

ADR-0033: Tier 1 NVRTC for ring rotation + lex-min scan, Tier 3a CCCL for multi-part sorting via segmented_sort. ADR-0002: COARSE class, dual fp32/fp64. Storage reads stay double, lex comparison uses compute_t after coordinate centering.

Functions

normalize_owned(...)

Normalize geometries to canonical form.

normalize_native_tabular_result(owned, *[, ...])

Module Contents

vibespatial.constructive.normalize.normalize_owned(owned: vibespatial.geometry.owned.OwnedGeometryArray, *, dispatch_mode: vibespatial.runtime.ExecutionMode | str = ExecutionMode.AUTO, precision: vibespatial.runtime.precision.PrecisionMode | str = PrecisionMode.AUTO) vibespatial.geometry.owned.OwnedGeometryArray

Normalize geometries to canonical form.

GPU path uses NVRTC kernels for ring rotation and linestring reversal, CCCL segmented_sort for multi-part ordering. Falls back to Shapely for small inputs or when GPU is unavailable.

vibespatial.constructive.normalize.normalize_native_tabular_result(owned: vibespatial.geometry.owned.OwnedGeometryArray, *, dispatch_mode: vibespatial.runtime.ExecutionMode | str = ExecutionMode.AUTO, precision: vibespatial.runtime.precision.PrecisionMode | str = PrecisionMode.AUTO, crs=None, geometry_name: str = 'geometry', source_rows=None, source_tokens: tuple[str, Ellipsis] = (), attrs: dict[str, object] | None = None)