[GH-2039] Geopandas.GeoSeries: Implement from_wkb, from_wkt, from_xy + temp __init__ fix#2040
Merged
Merged
Conversation
petern48
commented
Jul 1, 2025
Member
Author
|
@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. |
Contributor
There was a problem hiding this comment.
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_selecthelper ingeoseries.py. - Introduce a hack in
__init__to callsuper().__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 |
jiayuasu
approved these changes
Jul 4, 2025
Kontinuation
pushed a commit
to Kontinuation/sedona
that referenced
this pull request
Jan 21, 2026
…om_xy + temp __init__ fix (apache#2040)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Did you read the Contributor Guide?
Is this PR related to a ticket?
[GH-XXX] my subject. Closes Geopandas.GeoSeries: Implement from_wkb, from_wkt, from_xy #2039What changes were proposed in this PR?
__init__constructor so it now correctly callssuper().__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?