vibespatial.constructive.boundary

GPU-accelerated boundary computation.

Computes the topological boundary of each geometry: - Point / MultiPoint: boundary is empty (None per Shapely convention). - LineString: boundary is the two endpoints as MultiPoint. - Polygon: boundary is all rings (exterior + holes) as MultiLineString. - MultiLineString: boundary is endpoints of all parts as MultiPoint. - MultiPolygon: boundary is all rings from all polygons as MultiLineString.

GPU paths for all six geometry families avoid the Shapely round-trip entirely. Polygon and MultiPolygon boundary use pure offset-relabeling (zero-copy for coordinates). LineString and MultiLineString boundary use vectorized CuPy endpoint extraction.

ADR-0033 classification: Tier 2 (CuPy) for endpoint gather/interleave, pure offset relabeling for polygon/multipolygon boundary. No custom NVRTC kernel needed because no path involves geometry-specific inner loops.

ADR-0002: CONSTRUCTIVE class – stays fp64 by design per ADR-0002. PrecisionPlan wired at dispatch for observability.

Attributes

cp

Functions

boundary_owned(...)

Compute the topological boundary of each geometry.

Module Contents

vibespatial.constructive.boundary.cp = None
vibespatial.constructive.boundary.boundary_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

Compute the topological boundary of each geometry.

Returns an OwnedGeometryArray whose geometry type depends on the input: - Point / MultiPoint rows produce None (empty boundary). - LineString rows produce MultiPoint (the two endpoints). - Polygon rows produce MultiLineString (ring boundaries). - MultiLineString rows produce MultiPoint (endpoints of all parts). - MultiPolygon rows produce MultiLineString (all rings as LineStrings).

Parameters

ownedOwnedGeometryArray

Input geometries.

dispatch_modeExecutionMode or str, default AUTO

Execution mode hint. GPU dispatches to the device-native CuPy-based implementation for all geometry families.

precisionPrecisionMode or str, default AUTO

Precision mode. CONSTRUCTIVE class stays fp64 by design per ADR-0002; wired here for observability.

Returns

OwnedGeometryArray

Boundary geometries.