vibespatial.predicates.polygon

Attributes

Functions

evaluate_predicate_from_de9im(→ numpy.ndarray)

Evaluate a spatial predicate from DE-9IM bitmasks.

compute_polygon_de9im_gpu(→ numpy.ndarray | None)

Compute DE-9IM bitmasks for geometry candidate pairs on GPU.

supported_predicate_families(...)

Return the set of family pairs supported by polygon predicate kernels.

Module Contents

vibespatial.predicates.polygon.DE9IM_II = 1
vibespatial.predicates.polygon.DE9IM_IB = 2
vibespatial.predicates.polygon.DE9IM_IE = 4
vibespatial.predicates.polygon.DE9IM_BI = 8
vibespatial.predicates.polygon.DE9IM_BB = 16
vibespatial.predicates.polygon.DE9IM_BE = 32
vibespatial.predicates.polygon.DE9IM_EI = 64
vibespatial.predicates.polygon.DE9IM_EB = 128
vibespatial.predicates.polygon.DE9IM_EE = 256
vibespatial.predicates.polygon.evaluate_predicate_from_de9im(masks: numpy.ndarray, predicate: str) numpy.ndarray

Evaluate a spatial predicate from DE-9IM bitmasks.

Parameters

masks : uint16 array of DE-9IM bitmasks predicate : one of the supported predicate names

Returns

bool array

vibespatial.predicates.polygon.compute_polygon_de9im_gpu(query_owned: vibespatial.geometry.owned.OwnedGeometryArray, tree_owned: vibespatial.geometry.owned.OwnedGeometryArray, left_indices: numpy.ndarray, right_indices: numpy.ndarray, *, query_family: vibespatial.geometry.buffers.GeometryFamily, tree_family: vibespatial.geometry.buffers.GeometryFamily, d_left: object | None = None, d_right: object | None = None) numpy.ndarray | None

Compute DE-9IM bitmasks for geometry candidate pairs on GPU.

Supports all combinations of LINESTRING, MULTILINESTRING, POLYGON, and MULTIPOLYGON families.

When d_left / d_right are provided (device-resident CuPy int32 arrays), they are used directly instead of uploading left_indices / right_indices from host — avoiding a redundant host→device transfer when candidates are already on device.

Returns uint16 array of DE-9IM bitmasks, or None if the family pair is not supported.

vibespatial.predicates.polygon.supported_predicate_families() frozenset[tuple[vibespatial.geometry.buffers.GeometryFamily, vibespatial.geometry.buffers.GeometryFamily]]

Return the set of family pairs supported by polygon predicate kernels.