Repository: geopandas/geopandas

Issue:
DOC: spatial index query docs do not include all predicates
Our docstring for query and query bulk contains only a subset of predicates pygeos supports. See https://geopandas.org/en/latest/docs/reference/api/geopandas.sindex.SpatialIndex.query_bulk.html#geopandas-sindex-spatialindex-query-bulk does not list all supported predicates. Compare to https://pygeos.readthedocs.io/en/stable/strtree.html#pygeos.strtree.STRtree.query_bulk


Discussion:

Resolving patch:
diff --git a/geopandas/sindex.py b/geopandas/sindex.py
--- a/geopandas/sindex.py
+++ b/geopandas/sindex.py
@@ -55,8 +55,8 @@ def query(self, geometry, predicate=None, sort=False):
         ----------
         geometry : shapely geometry
             A single shapely geometry to query against the spatial index.
-        predicate : {None, 'intersects', 'within', 'contains', \
-'overlaps', 'crosses', 'touches'}, optional
+        predicate : {None, "contains", "contains_properly", "covered_by", "covers", \
+"crosses", "intersects", "overlaps", "touches", "within"}, optional
             If predicate is provided, the input geometry is
             tested using the predicate function against each item
             in the tree whose extent intersects the envelope of the
@@ -118,8 +118,8 @@ def query_bulk(self, geometry, predicate=None, sort=False):
         geometry : {GeoSeries, GeometryArray, numpy.array of PyGEOS geometries}
             Accepts GeoPandas geometry iterables (GeoSeries, GeometryArray)
             or a numpy array of PyGEOS geometries.
-        predicate : {None, 'intersects', 'within', 'contains', 'overlaps', \
-'crosses', 'touches'}, optional
+        predicate : {None, "contains", "contains_properly", "covered_by", "covers", \
+"crosses", "intersects", "overlaps", "touches", "within"}, optional
             If predicate is provided, the input geometries are tested using
             the predicate function against each item in the tree whose extent
             intersects the envelope of the each input geometry:
@@ -437,6 +437,7 @@ def valid_query_predicates(self):
                 "overlaps",
                 "crosses",
                 "touches",
+                "covered_by",
                 "covers",
                 "contains_properly",
             }
@@ -502,6 +503,7 @@ def query(self, geometry, predicate=None, sort=False):
                 if predicate in (
                     "contains",
                     "intersects",
+                    "covered_by",
                     "covers",
                     "contains_properly",
                 ):
@@ -669,8 +671,8 @@ def valid_query_predicates(self):
             >>> from shapely.geometry import Point
             >>> s = geopandas.GeoSeries([Point(0, 0), Point(1, 1)])
             >>> s.sindex.valid_query_predicates  # doctest: +SKIP
-            {'contains', 'crosses', 'covered_by', None, 'intersects', 'within', \
-'touches', 'overlaps', 'contains_properly', 'covers'}
+            {None, "contains", "contains_properly", "covered_by", "covers", \
+"crosses", "intersects", "overlaps", "touches", "within"}
             """
             return _PYGEOS_PREDICATES
 


Test patch:
diff --git a/geopandas/tools/tests/test_sjoin.py b/geopandas/tools/tests/test_sjoin.py
--- a/geopandas/tools/tests/test_sjoin.py
+++ b/geopandas/tools/tests/test_sjoin.py
@@ -269,7 +269,19 @@ def test_empty_join(self):
         empty = sjoin(not_in, polygons, how="inner", predicate="intersects")
         assert empty.empty
 
-    @pytest.mark.parametrize("predicate", ["intersects", "contains", "within"])
+    @pytest.mark.parametrize(
+        "predicate",
+        [
+            "contains",
+            "contains_properly",
+            "covered_by",
+            "covers",
+            "crosses",
+            "intersects",
+            "touches",
+            "within",
+        ],
+    )
     @pytest.mark.parametrize(
         "empty",
         [