You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sedona.apache.org by "petern48 (via GitHub)" <gi...@apache.org> on 2025/07/04 03:46:43 UTC
[PR] [GH-2060] Geopandas.GeoSeries: Implement crosses, overlaps, touches, within, covers, covered_by, contains [sedona]
petern48 opened a new pull request, #2061:
URL: https://github.com/apache/sedona/pull/2061
## Did you read the Contributor Guide?
- Yes, I have read the [Contributor Rules](https://sedona.apache.org/latest/community/rule/) and [Contributor Development Guide](https://sedona.apache.org/latest/community/develop/)
## Is this PR related to a ticket?
- Yes, and the PR name follows the format `[GH-XXX] my subject`. Closes #2060
## What changes were proposed in this PR?
Implement crosses, overlaps, touches, within, covers, covered_by, contains
## How was this patch tested?
Added tests
## Did this PR include necessary documentation updates?
- Yes, I have updated the documentation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [GH-2060] Geopandas.GeoSeries: Implement crosses, overlaps, touches, within, covers, covered_by, contains [sedona]
Posted by "petern48 (via GitHub)" <gi...@apache.org>.
petern48 commented on PR #2061:
URL: https://github.com/apache/sedona/pull/2061#issuecomment-3070423713
FYI: https://github.com/apache/sedona/issues/2059
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [GH-2060] Geopandas.GeoSeries: Implement crosses, overlaps, touches, within, covers, covered_by, contains, distance [sedona]
Posted by "petern48 (via GitHub)" <gi...@apache.org>.
petern48 commented on PR #2061:
URL: https://github.com/apache/sedona/pull/2061#issuecomment-3090252423
@jiayuasu done and passing
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [GH-2060] Geopandas.GeoSeries: Implement crosses, overlaps, touches, within, covers, covered_by, contains, distance [sedona]
Posted by "jiayuasu (via GitHub)" <gi...@apache.org>.
jiayuasu merged PR #2061:
URL: https://github.com/apache/sedona/pull/2061
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [GH-2060] Geopandas.GeoSeries: Implement crosses, overlaps, touches, within, covers, covered_by, contains, distance [sedona]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #2061:
URL: https://github.com/apache/sedona/pull/2061#discussion_r2216341527
##########
python/tests/geopandas/test_match_geopandas_series.py:
##########
@@ -700,8 +725,150 @@ def test_intersection(self):
def test_intersection_all(self):
pass
+ def test_overlaps(self):
+ for _, geom in self.geoms:
+ for _, geom2 in self.geoms:
+ # Sedona's results differ from geopandas for these cases
+ if geom == geom2 or self.contains_any_geom_collection(geom, geom2):
+ continue
+
+ sgpd_result = GeoSeries(geom).overlaps(GeoSeries(geom2, align=True))
+ gpd_result = gpd.GeoSeries(geom).overlaps(
+ gpd.GeoSeries(geom2), align=True
+ )
+ self.check_pd_series_equal(sgpd_result, gpd_result)
+
+ if len(geom) == len(geom2):
+ sgpd_result = GeoSeries(geom).overlaps(
+ GeoSeries(geom2), align=False
+ )
+ gpd_result = gpd.GeoSeries(geom).overlaps(
+ gpd.GeoSeries(geom2), align=False
+ )
+ self.check_pd_series_equal(sgpd_result, gpd_result)
+
+ def test_touches(self):
+ for _, geom in self.geoms:
+ for _, geom2 in self.geoms:
+ if self.contains_any_geom_collection(geom, geom2):
+ continue
+ sgpd_result = GeoSeries(geom).touches(GeoSeries(geom2), align=True)
+ gpd_result = gpd.GeoSeries(geom).touches(
+ gpd.GeoSeries(geom2), align=True
+ )
+ self.check_pd_series_equal(sgpd_result, gpd_result)
+
+ if len(geom) == len(geom2):
+ sgpd_result = GeoSeries(geom).touches(GeoSeries(geom2), align=False)
+ gpd_result = gpd.GeoSeries(geom).touches(
+ gpd.GeoSeries(geom2), align=False
+ )
+ self.check_pd_series_equal(sgpd_result, gpd_result)
+
+ def test_within(self):
+ for _, geom in self.geoms:
+ for _, geom2 in self.geoms:
+ if geom == geom2 or self.contains_any_geom_collection(geom, geom2):
+ continue
+
+ sgpd_result = GeoSeries(geom).within(GeoSeries(geom2), align=True)
+ gpd_result = gpd.GeoSeries(geom).within(
+ gpd.GeoSeries(geom2), align=True
+ )
+
+ self.check_pd_series_equal(sgpd_result, gpd_result)
+
+ if len(geom) == len(geom2):
+ sgpd_result = GeoSeries(geom).within(GeoSeries(geom2), align=False)
+ gpd_result = gpd.GeoSeries(geom).within(
+ gpd.GeoSeries(geom2), align=False
+ )
+ self.check_pd_series_equal(sgpd_result, gpd_result)
+
+ def test_covers(self):
+ if parse_version(gpd.__version__) < parse_version("0.8.0"):
+ pytest.skip("geopandas < 0.8.0 does not support covered_by")
+
+ for _, geom in self.geoms:
+ for _, geom2 in self.geoms:
+ if geom == geom2 or self.contains_any_geom_collection(geom, geom2):
+ continue
+
+ print(geom, geom2)
+ sgpd_result = GeoSeries(geom).covers(GeoSeries(geom2), align=True)
Review Comment:
Debug print statement should be removed from production test code
```suggestion
sgpd_result = GeoSeries(geom).covers(GeoSeries(geom2), align=True)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org