cuspa.tl.overlap_pairs#
- cuspa.tl.overlap_pairs(
- points: Any,
- polygons: Polygons,
- *,
- predicate: Literal['contains', 'intersects'] = 'contains',
- stream: int = 0,
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)whereKis the total number of - containments.
Kmay exceed 2^31-1; the output then needs 8 * Kbytes 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.
- int32 tensor of shape