Skip to content

[GH-2041] Implement boundary, centroid, envelope#2042

Merged
jiayuasu merged 9 commits into
apache:masterfrom
petern48:boundary_series
Jul 12, 2025
Merged

[GH-2041] Implement boundary, centroid, envelope#2042
jiayuasu merged 9 commits into
apache:masterfrom
petern48:boundary_series

Conversation

@petern48
Copy link
Copy Markdown
Member

@petern48 petern48 commented Jul 1, 2025

Did you read the Contributor Guide?

Is this PR related to a ticket?

What changes were proposed in this PR?

Implement boundary, centroid, envelope

How was this patch tested?

Added tests

Did this PR include necessary documentation updates?

  • Yes, I have updated the documentation.

@petern48 petern48 requested a review from zhangfengcdt July 3, 2025 21:52
@petern48 petern48 marked this pull request as ready for review July 3, 2025 21:52
@petern48 petern48 requested a review from jiayuasu as a code owner July 3, 2025 21:52
@petern48 petern48 marked this pull request as draft July 10, 2025 20:20
@petern48 petern48 marked this pull request as ready for review July 11, 2025 18:09
@petern48
Copy link
Copy Markdown
Member Author

Tests are now passing again after merging in the recent changes

Copy link
Copy Markdown
Member

@zhangfengcdt zhangfengcdt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhangfengcdt zhangfengcdt requested a review from Copilot July 11, 2025 22:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements the previously unimplemented boundary, centroid, and envelope properties on GeoSeries and adds corresponding end-to-end tests.

  • Added concrete implementations for GeoSeries.boundary, GeoSeries.centroid, and GeoSeries.envelope in geoseries.py, including documentation and SQL translation logic.
  • Updated WKB loading in _to_geopandas to guard null values using pd.isna.
  • Expanded the pytest suite in test_match_geopandas_series.py and test_geoseries.py to validate the new methods against GeoPandas.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
python/tests/geopandas/test_match_geopandas_series.py Added loops for testing boundary, centroid, and envelope cases, with a version guard for shapely boundary behavior
python/tests/geopandas/test_geoseries.py Added explicit unit tests for boundary, centroid, and envelope on GeoSeries
python/sedona/geopandas/geoseries.py Implemented the three new properties and improved null-handling in _to_geopandas

Comment thread python/tests/geopandas/test_match_geopandas_series.py
@jiayuasu jiayuasu added this to the sedona-1.8.0 milestone Jul 12, 2025
@jiayuasu jiayuasu merged commit 5994464 into apache:master Jul 12, 2025
25 checks passed
Subham-KRLX pushed a commit to Subham-KRLX/sedona that referenced this pull request Jul 17, 2025
* Implement boundary

* Implement centroid

* Implement envelope

* Skip boundary test for geom collection for shapely < 2.0.0

* Fix doc strings to use sedona instead of geoseries

* Support na values in to_geopandas
@petern48 petern48 deleted the boundary_series branch July 20, 2025 01:42
Kontinuation pushed a commit to Kontinuation/sedona that referenced this pull request Jan 21, 2026
* Implement boundary

* Implement centroid

* Implement envelope

* Skip boundary test for geom collection for shapely < 2.0.0

* Fix doc strings to use sedona instead of geoseries

* Support na values in to_geopandas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Geopandas.GeoSeries: Implement boundary, centroid, envelope

4 participants