vibespatial.constructive.representative_point

GPU-accelerated representative_point using layered centroid + PIP strategy.

Architecture (ADR-0033 tier classification): - Points: identity (Tier 2 CuPy element-wise copy) - LineStrings: midpoint interpolation (Tier 1 NVRTC) - Polygons/MultiPolygons: centroid (existing GPU kernel) + PIP containment

check, with Shapely fallback only for the compact subset where centroid falls outside (ADR-0019 compact-invalid-row pattern)

Precision (ADR-0002): Centroid computation uses METRIC class dispatch (fp32+Kahan on consumer GPU, fp64 on datacenter). PIP check uses PREDICATE class dispatch.

Functions

representative_point_owned(...)

Compute a representative point for each geometry in the owned array.

Module Contents

vibespatial.constructive.representative_point.representative_point_owned(owned: vibespatial.geometry.owned.OwnedGeometryArray) vibespatial.geometry.owned.OwnedGeometryArray

Compute a representative point for each geometry in the owned array.

Returns a point-only OwnedGeometryArray where each point is guaranteed to lie inside (or on the boundary of) the corresponding input geometry.

Strategy: 1. Points -> identity (the point itself) 2. LineStrings/MultiLineStrings -> midpoint of coordinate extent 3. Polygons/MultiPolygons -> GPU centroid, with Shapely point_on_surface

fallback for concave geometries where centroid falls outside