vibespatial.constructive.remove_repeated_points¶
GPU-accelerated removal of repeated (consecutive duplicate) points.
Per ring/linestring (sequential within, parallel across): 1. For each coordinate, compute squared distance to the previous kept coordinate 2. Mark as “keep” if distance >= tolerance^2 (or if it is the first point) 3. Special case: for Polygon rings, always keep the last point if it closes
the ring (matches first point)
Compact kept coordinates using CuPy fancy indexing
Rebuild geometry offsets from per-ring/per-linestring kept counts
- ADR-0033: Tier 1 NVRTC for per-ring scan (sequential dependency: compare to
previous kept point, so one thread per ring/linestring). Tier 3a CCCL for exclusive_sum on per-span kept counts. Tier 2 CuPy for gather (compact).
- ADR-0002: CONSTRUCTIVE class – stays fp64 on all devices per policy.
PrecisionPlan wired through for observability only.
ADR-0034: NVRTC precompilation via request_nvrtc_warmup at module scope.
Attributes¶
Functions¶
Remove repeated (consecutive duplicate) points from geometries. |
Module Contents¶
- vibespatial.constructive.remove_repeated_points.cp = None¶
- vibespatial.constructive.remove_repeated_points.logger¶
- vibespatial.constructive.remove_repeated_points.remove_repeated_points_owned(owned: vibespatial.geometry.owned.OwnedGeometryArray, tolerance: float = 0.0, *, dispatch_mode: vibespatial.runtime.ExecutionMode | str = ExecutionMode.AUTO, precision: vibespatial.runtime.precision.PrecisionMode | str = PrecisionMode.AUTO) vibespatial.geometry.owned.OwnedGeometryArray¶
Remove repeated (consecutive duplicate) points from geometries.
For each ring/linestring, sequentially scans coordinates and removes any point within
tolerancedistance of the previous kept point. Always preserves ring closure for polygons.Parameters¶
- ownedOwnedGeometryArray
Input geometries.
- tolerancefloat
Distance threshold. Points closer than this to the previous kept point are removed. Default 0.0 removes exact duplicates.
- dispatch_modeExecutionMode
Execution mode selection (AUTO / CPU / GPU).
- precisionPrecisionMode
Precision mode selection (AUTO / FP32 / FP64).
Returns¶
- OwnedGeometryArray
New geometry array with repeated points removed.