resqpy.olio.point_inclusion.pip_array_cn(p_a, poly)[source]

Return bool array of 2D points inclusion, True where point is inside polygon.

Uses crossing number algorithm.

  • p_a (2D numpy float array) – set of xy points to test for inclusion in polygon

  • poly (2D numpy array, tuple or list of tuples or lists of at least 2 floats) – the xy points defining a polygon


numpy boolean vector – True where corresponding point in p_a is within the polygon


if the polygon is represented by a closed resqpy Polyline, pass Polyline.coordinates as poly