[poly_contains_points] consistently return boolean arrays
This commit is contained in:
parent
d0b48e6bfc
commit
5cb608734d
1 changed files with 2 additions and 2 deletions
|
|
@ -62,7 +62,7 @@ def poly_contains_points(
|
||||||
vertices: ArrayLike,
|
vertices: ArrayLike,
|
||||||
points: ArrayLike,
|
points: ArrayLike,
|
||||||
include_boundary: bool = True,
|
include_boundary: bool = True,
|
||||||
) -> NDArray[numpy.int_]:
|
) -> NDArray[numpy.bool_]:
|
||||||
"""
|
"""
|
||||||
Tests whether the provided points are inside the implicitly closed polygon
|
Tests whether the provided points are inside the implicitly closed polygon
|
||||||
described by the provided list of vertices.
|
described by the provided list of vertices.
|
||||||
|
|
@ -81,7 +81,7 @@ def poly_contains_points(
|
||||||
vertices = numpy.asarray(vertices, dtype=float)
|
vertices = numpy.asarray(vertices, dtype=float)
|
||||||
|
|
||||||
if points.size == 0:
|
if points.size == 0:
|
||||||
return numpy.zeros(0, dtype=numpy.int8)
|
return numpy.zeros(0, dtype=bool)
|
||||||
|
|
||||||
min_bounds = numpy.min(vertices, axis=0)[None, :]
|
min_bounds = numpy.min(vertices, axis=0)[None, :]
|
||||||
max_bounds = numpy.max(vertices, axis=0)[None, :]
|
max_bounds = numpy.max(vertices, axis=0)[None, :]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue