Skip to content

[GH-1993] Geopandas.Series __repr__() and to_geopandas()#1990

Merged
jiayuasu merged 4 commits into
apache:masterfrom
petern48:geopandas_repr_and_to_geopandas
Jun 20, 2025
Merged

[GH-1993] Geopandas.Series __repr__() and to_geopandas()#1990
jiayuasu merged 4 commits into
apache:masterfrom
petern48:geopandas_repr_and_to_geopandas

Conversation

@petern48

Copy link
Copy Markdown
Member

Did you read the Contributor Guide?

Is this PR related to a ticket?

  • Yes, and the PR name follows the format [SEDONA-XXX] my subject.

What changes were proposed in this PR?

  • Implement to_geopandas() for converting a sedona GeoSeries into a geopandas GeoSeries
  • Implement __repr__() method to properly display the geoseries

How was this patch tested?

  • Added a new check_geoseries_equal() function to prep the test framework
  • Confirming that the print output is correct was done manually.

Did this PR include necessary documentation updates?

  • Yes, I have updated the documentation.

@petern48

Copy link
Copy Markdown
Member Author

Previously printing a sedona GeoSeries output it in WKB format.

0    [1, 1, 0, 0, 0, 51, 51, 51, 51, 51, 51, 243, 6...
1    [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0,...
2    [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 64, 0, 0,...
3    [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 64, 0, 0...
dtype: object

This PR converts it to properly display in WKT, matching Geopandas.

0    POINT (1.20000 1.00000)                                                    
1    POINT (2.00000 2.00000)
2    POINT (3.00000 3.00000)
3    POINT (4.00000 4.00000)
dtype: geometry

@jiayuasu jiayuasu requested a review from zhangfengcdt June 20, 2025 00:01
Comment thread python/tests/geopandas/test_geoseries.py

@zhangfengcdt zhangfengcdt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Thanks!

@jiayuasu jiayuasu changed the title [SEDONA-720] Geopandas __repr__() and to_geopandas() [GH-1993] Geopandas __repr__() and to_geopandas() Jun 20, 2025
@jiayuasu jiayuasu linked an issue Jun 20, 2025 that may be closed by this pull request
@jiayuasu

Copy link
Copy Markdown
Member

@petern48 great work. For new issues in the future, please first create a GitHub issue (we are deprecating JIRA) and then link to that GitHub issue.

@jiayuasu jiayuasu added this to the sedona-1.8.0 milestone Jun 20, 2025
@jiayuasu jiayuasu merged commit 0a8dd86 into apache:master Jun 20, 2025
25 checks passed
@petern48 petern48 deleted the geopandas_repr_and_to_geopandas branch June 21, 2025 00:15
@petern48 petern48 changed the title [GH-1993] Geopandas __repr__() and to_geopandas() [GH-1993] Geopandas.Series __repr__() and to_geopandas() Jun 21, 2025
Kontinuation pushed a commit to Kontinuation/sedona that referenced this pull request Jan 21, 2026
* Implement to_geopandas and __repr__ for GeoSeries

* Add check_geoseries_equal() to test_geoseries

* Use wkb.loads instead of from_wkb and fix lint

* Combine check_geoseries and check_geoseries_equal into one function
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 __repr__() and to_geopandas()

3 participants