Skip to content

Commit

Permalink
DOC: add note about prepare + touches to contains_xy/intersects_xy do…
Browse files Browse the repository at this point in the history
…cstrings (#1631)

Co-authored-by: Brendan Ward <bcward@astutespruce.com>
  • Loading branch information
jorisvandenbossche and brendan-ward committed Dec 6, 2022
1 parent cc9250e commit eba985c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions shapely/predicates.py
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,12 @@ def contains_xy(geom, x, y=None, **kwargs):
--------
contains : variant taking two geometries as input
Notes
-----
If you compare a small number of polygons or lines with many points,
it can be beneficial to prepare the geometries in advance using
:func:`shapely.prepare`.
Examples
--------
>>> from shapely import Point, Polygon
Expand Down Expand Up @@ -1154,6 +1160,15 @@ def intersects_xy(geom, x, y=None, **kwargs):
--------
intersects : variant taking two geometries as input
Notes
-----
If you compare a single or few geometries with many points, it can be
beneficial to prepare the geometries in advance using
:func:`shapely.prepare`.
The `touches` predicate can be determined with this function by getting
the boundary of the geometries: ``intersects_xy(boundary(geom), x, y)``.
Examples
--------
>>> from shapely import LineString, Point
Expand Down

0 comments on commit eba985c

Please sign in to comment.