cuspa.tl.overlap_pairs#

cuspa.tl.overlap_pairs(
points: Any,
polygons: Polygons,
*,
predicate: Literal['contains', 'intersects'] = 'contains',
stream: int = 0,
) → Any#

Return all matching (point_idx, polygon_idx) pairs.

A point can appear more than once when polygons overlap.

Parameters:
points

Device tensor of shape (N, 2) or flat interleaved (2N,).

polygons

cuspa.Polygons. The shared uniform-grid index is built on first call and reused.

predicate

"contains" (default) or "intersects" (edge-inclusive).

stream

CUDA stream handle.

Returns:
int32 tensor of shape (K, 2) where K is the total number of
containments. K may exceed 2^31-1; the output then needs
8 * K bytes of device memory. Column 0 is point index, column 1 is polygon index. Rows
are ordered by point_idx, then by the polygon’s position in the grid
cell list.