vibespatial.kernels.constructive.nonpolygon_binary

GPU kernels for non-polygon binary constructive operations.

Handles family combinations that do not involve Polygon-Polygon pairs: - Point-Point: coordinate comparison with tolerance - MultiPoint-Polygon: batch PIP with compaction - Point-LineString: point-to-segment minimum distance - LineString-Polygon: segment clipping against polygon boundary - LineString-LineString: segment-segment intersection

All kernels return device-resident OwnedGeometryArray instances.

ADR-0033: Mixed tiers.
  • Point-Point: Tier 2 (CuPy element-wise)

  • MultiPoint-Polygon: Tier 2 over Tier 1 PIP kernel

  • Point-LineString: Tier 1 (custom NVRTC, geometry-specific inner loop)

  • LineString-Polygon: Tier 1 (custom NVRTC, segment-ring traversal)

  • LineString-LineString: Tier 1 (custom NVRTC, segment-segment intersection)

ADR-0002: CONSTRUCTIVE class – stays fp64 on all devices per policy. ADR-0034: NVRTC precompilation via request_nvrtc_warmup at module scope.

Attributes

Functions

point_point_intersection(...)

Point-Point intersection: keep rows where coordinates match.

point_point_difference(...)

Point-Point difference: keep rows where coordinates differ.

point_point_union(...)

Point-Point union: keep all unique coordinates.

point_point_symmetric_difference(...)

Point-Point symmetric_difference: keep if only one side has a point.

point_linestring_intersection(...)

Point-LineString intersection: keep points that lie on the linestring.

point_linestring_difference(...)

Point-LineString difference: keep points that do NOT lie on the linestring.

linestring_polygon_intersection(linestrings, polygons, *)

Intersect aligned lineal and polygonal rows through shared topology.

linestring_polygon_difference(...)

Subtract aligned polygonal rows through shared split topology.

linestring_linestring_intersection_native(left, right, *)

Classify aligned segment relations and assemble exact mixed results.

Module Contents

vibespatial.kernels.constructive.nonpolygon_binary.logger
vibespatial.kernels.constructive.nonpolygon_binary.point_point_intersection(left: vibespatial.geometry.owned.OwnedGeometryArray, right: vibespatial.geometry.owned.OwnedGeometryArray) vibespatial.geometry.owned.OwnedGeometryArray

Point-Point intersection: keep rows where coordinates match.

Uses CuPy element-wise comparison (Tier 2). Returns device-resident OwnedGeometryArray.

vibespatial.kernels.constructive.nonpolygon_binary.point_point_difference(left: vibespatial.geometry.owned.OwnedGeometryArray, right: vibespatial.geometry.owned.OwnedGeometryArray) vibespatial.geometry.owned.OwnedGeometryArray

Point-Point difference: keep rows where coordinates differ.

difference(a, b) = a where a != b, NULL where a == b. If right is NULL, keep left. If left is NULL, result is NULL.

vibespatial.kernels.constructive.nonpolygon_binary.point_point_union(left: vibespatial.geometry.owned.OwnedGeometryArray, right: vibespatial.geometry.owned.OwnedGeometryArray) vibespatial.geometry.owned.OwnedGeometryArray

Point-Point union: keep all unique coordinates.

For element-wise union of two Point arrays, the result per row is: - If both are the same point -> the point (as Point) - If both are different -> MultiPoint with both - If only one is valid -> that point - If neither is valid -> NULL

For simplicity and to maintain consistent output type per row, we output MultiPoints. Rows with a single point get a MultiPoint with 1 point. Rows with matching points get a MultiPoint with 1 point.

vibespatial.kernels.constructive.nonpolygon_binary.point_point_symmetric_difference(left: vibespatial.geometry.owned.OwnedGeometryArray, right: vibespatial.geometry.owned.OwnedGeometryArray) vibespatial.geometry.owned.OwnedGeometryArray

Point-Point symmetric_difference: keep if only one side has a point.

If coordinates match, result is NULL (empty). If coordinates differ, result is MultiPoint with both. If only one valid, result is that point.

vibespatial.kernels.constructive.nonpolygon_binary.point_linestring_intersection(points: vibespatial.geometry.owned.OwnedGeometryArray, linestrings: vibespatial.geometry.owned.OwnedGeometryArray) vibespatial.geometry.owned.OwnedGeometryArray

Point-LineString intersection: keep points that lie on the linestring.

vibespatial.kernels.constructive.nonpolygon_binary.point_linestring_difference(points: vibespatial.geometry.owned.OwnedGeometryArray, linestrings: vibespatial.geometry.owned.OwnedGeometryArray) vibespatial.geometry.owned.OwnedGeometryArray

Point-LineString difference: keep points that do NOT lie on the linestring.

vibespatial.kernels.constructive.nonpolygon_binary.linestring_polygon_intersection(linestrings: vibespatial.geometry.owned.OwnedGeometryArray, polygons: vibespatial.geometry.owned.OwnedGeometryArray, *, crs=None)

Intersect aligned lineal and polygonal rows through shared topology.

vibespatial.kernels.constructive.nonpolygon_binary.linestring_polygon_difference(linestrings: vibespatial.geometry.owned.OwnedGeometryArray, polygons: vibespatial.geometry.owned.OwnedGeometryArray) vibespatial.geometry.owned.OwnedGeometryArray | None

Subtract aligned polygonal rows through shared split topology.

vibespatial.kernels.constructive.nonpolygon_binary.linestring_linestring_intersection_native(left: vibespatial.geometry.owned.OwnedGeometryArray, right: vibespatial.geometry.owned.OwnedGeometryArray, *, crs=None)

Classify aligned segment relations and assemble exact mixed results.

Physical shape: same-row segment candidate pages become point and overlap capacities. Points are deduplicated by output row, overlap spans are noded and deduplicated as atomic lines, and points covered by those lines are removed. Mixed rows remain a native geometry composition until export.