This is an automated email from the ASF dual-hosted git repository.
jiayu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sedona.git
The following commit(s) were added to refs/heads/master by this push:
new e41445e6e5 [GH-2279] Geopandas: Support sjoin with `covers` and
`covered_by` predicates (#2280)
e41445e6e5 is described below
commit e41445e6e5b96ff8abed79e502989289934c7d8d
Author: Peter Nguyen <[email protected]>
AuthorDate: Thu Aug 14 16:25:52 2025 -0700
[GH-2279] Geopandas: Support sjoin with `covers` and `covered_by`
predicates (#2280)
* Geopandas: Support covers and covered_by sjoin
* Update docs
---
python/sedona/spark/geopandas/geodataframe.py | 2 +-
python/sedona/spark/geopandas/tools/sjoin.py | 3 +++
python/tests/geopandas/test_sjoin.py | 3 +++
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/python/sedona/spark/geopandas/geodataframe.py
b/python/sedona/spark/geopandas/geodataframe.py
index 0343e8a66f..0153588a7e 100644
--- a/python/sedona/spark/geopandas/geodataframe.py
+++ b/python/sedona/spark/geopandas/geodataframe.py
@@ -1463,7 +1463,7 @@ class GeoDataFrame(GeoFrame, pspd.DataFrame):
* 'right': use keys from right_df; retain only right_df geometry
column
* 'inner': use intersection of keys from both dfs; retain only
left_df geometry column
predicate : str, default 'intersects'
- Binary predicate. Valid values: 'intersects', 'contains',
'within', 'dwithin'
+ Binary predicate. Valid values: 'intersects', 'contains',
'within', 'dwithin', 'touches', 'crosses', 'overlaps', 'covers', 'covered_by'
lsuffix : str, default 'left'
Suffix to apply to overlapping column names (left GeoDataFrame).
rsuffix : str, default 'right'
diff --git a/python/sedona/spark/geopandas/tools/sjoin.py
b/python/sedona/spark/geopandas/tools/sjoin.py
index 8f137bc9cf..1e7aa6ab1c 100644
--- a/python/sedona/spark/geopandas/tools/sjoin.py
+++ b/python/sedona/spark/geopandas/tools/sjoin.py
@@ -73,6 +73,9 @@ def _frame_join(
"crosses": "ST_Crosses",
"overlaps": "ST_Overlaps",
"dwithin": "ST_DWithin",
+ "covers": "ST_Covers",
+ "covered_by": "ST_CoveredBy",
+ # "contains_properly": "ST_ContainsProperly", # not supported by
Sedona yet
}
if predicate not in predicate_map:
diff --git a/python/tests/geopandas/test_sjoin.py
b/python/tests/geopandas/test_sjoin.py
index 18a21edc7c..22c1708dbc 100644
--- a/python/tests/geopandas/test_sjoin.py
+++ b/python/tests/geopandas/test_sjoin.py
@@ -117,6 +117,9 @@ class TestSpatialJoin(TestGeopandasBase):
"touches",
"crosses",
"overlaps",
+ "covers",
+ "covered_by",
+ # "contains_properly", # not supported by Sedona yet
]
for predicate in predicates: