Repository navigation
[GH-2149] Geopandas: Implement to_file, from_file, read_file - #2150
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements the to_file, from_file, and read_file functions for the Geopandas compatibility layer in Sedona, enabling file I/O operations for GeoDataFrames and GeoSeries. The implementation adds support for multiple geospatial file formats including GeoJSON, GeoParquet, Shapefile, and GeoPackage.
Key changes:
- Added comprehensive I/O functionality with automatic format detection
- Fixed GeoDataFrame.getitem to handle non-integer indexes properly
- Modified buffer method to return GeoSeries instead of GeoDataFrame for consistency
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| python/sedona/geopandas/io.py | New module implementing core file I/O functionality with format detection and validation |
| python/sedona/geopandas/geodataframe.py | Added from_file/to_file methods, fixed getitem index handling, and updated buffer return type |
| python/sedona/geopandas/geoseries.py | Added from_file/to_file methods and updated _to_geoframe method |
| python/tests/geopandas/test_io.py | Comprehensive test suite covering all supported file formats and edge cases |
| python/tests/geopandas/test_geopandas_base.py | Added utility methods for index comparison in tests |
| python/tests/geopandas/test_geodataframe.py | Updated buffer test to match new return type |
| python/tests/geopandas/test_match_geopandas_series.py | Removed outdated test method |
| python/sedona/geopandas/init.py | Exported read_file function |
zhangfengcdt
approved these changes
Jul 25, 2025
jiayuasu
approved these changes
Jul 26, 2025
Kontinuation
pushed a commit
to Kontinuation/sedona
that referenced
this pull request
Jan 21, 2026
…le` (apache#2150) * Implement to_file, from_file, read_file * Fix ci * Delete __repr__()'s and _process_geometry_columnsi and PR feedback * Make format and extension case insensitive in read_file * Remove sort by GeoHash logic in to_file parquet
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: Implementto_file,from_file,read_file#2149What changes were proposed in this PR?
to_file,from_file,read_fileHow was this patch tested?
Added tests
Did this PR include necessary documentation updates?