Skip to content

[GH-2039] Geopandas.GeoSeries: Implement from_wkb, from_wkt, from_xy + temp __init__ fix#2040

Merged
jiayuasu merged 7 commits into
apache:masterfrom
petern48:from_wkt_series
Jul 4, 2025
Merged

[GH-2039] Geopandas.GeoSeries: Implement from_wkb, from_wkt, from_xy + temp __init__ fix#2040
jiayuasu merged 7 commits into
apache:masterfrom
petern48:from_wkt_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 from_wkb, from_wkt, from_xy
  • Implement a hacky fix for the __init__ constructor so it now correctly calls super().__init__ without failing on the ps.Series or sgpd.Series cases.

How was this patch tested?

Added tests

Did this PR include necessary documentation updates?

  • Yes, I have updated the documentation.

Comment thread python/sedona/geopandas/geoseries.py
@petern48 petern48 marked this pull request as ready for review July 1, 2025 23:54
@petern48 petern48 requested a review from jiayuasu as a code owner July 1, 2025 23:54
@petern48 petern48 requested a review from zhangfengcdt July 1, 2025 23:54
@petern48
Copy link
Copy Markdown
Member Author

petern48 commented Jul 2, 2025

@zhangfengcdt Can we request copilot on this one too? I can't do it myself and this PR is a larger blocker for other features.

@zhangfengcdt zhangfengcdt requested a review from Copilot July 2, 2025 19:16
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 GeoSeries.from_wkb, from_wkt, and from_xy constructors, adds corresponding tests, and applies a temporary workaround in the __init__ method to preserve geometry metadata.

  • Flesh out tests in two test modules to cover new constructors.
  • Add implementations for from_wkb, from_wkt, from_xy, and a private _create_from_select helper in geoseries.py.
  • Introduce a hack in __init__ to call super().__init__ on a pandas conversion and then restore the anchor.

Reviewed Changes

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

File Description
python/tests/geopandas/test_match_geopandas_series.py Replace pass placeholders with loops testing from_wkb, from_wkt, and from_xy against GeoPandas
python/tests/geopandas/test_geoseries.py Add concrete inputs for from_wkb, from_wkt, and from_xy, including 3D points
python/sedona/geopandas/geoseries.py Remove stubs, add implementations for new constructors and _create_from_select, and apply a temporary __init__ fix

Comment thread python/sedona/geopandas/geoseries.py
Comment thread python/sedona/geopandas/geoseries.py Outdated
Comment thread python/sedona/geopandas/geoseries.py Outdated
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

@jiayuasu jiayuasu merged commit c18ddda into apache:master Jul 4, 2025
26 checks passed
@petern48 petern48 deleted the from_wkt_series branch July 20, 2025 01:42
Kontinuation pushed a commit to Kontinuation/sedona that referenced this pull request Jan 21, 2026
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 from_wkb, from_wkt, from_xy

4 participants