- intersects_xy(geom, x, y=None, **kwargs)#
Returns True if A and the Point (x, y) share any portion of space.
This is a special-case (and faster) variant of the intersects function which avoids having to create a Point object if you start from x/y coordinates.
See the docstring of intersects for more details about the predicate.
- geomGeometry or array_like
- x, yfloat or array_like
Coordinates as separate x and y arrays, or a single array of coordinate x, y tuples.
For other keyword-only arguments, see the NumPy ufunc docs.
variant taking two geometries as input
If you compare a single or few geometries with many points, it can be beneficial to prepare the geometries in advance using
The touches predicate can be determined with this function by getting the boundary of the geometries:
intersects_xy(boundary(geom), x, y).
>>> from shapely import LineString, Point >>> line = LineString([(0, 0), (1, 1)]) >>> intersects(line, Point(0, 0)) True >>> intersects_xy(line, 0, 0) True