[GH-2025] Geopandas.GeoSeries: Implement is_valid, is_empty, is_simple#2026
Merged
Conversation
jiayuasu
approved these changes
Jul 2, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
Implements geometry validity, emptiness, and simplicity checks in GeoSeries, updates WKB conversion to handle None, and adds corresponding tests.
- Implemented
is_valid,is_empty, andis_simpleby invoking respective Spark SQL functions. - Updated constructor to emit
Nonefor missing geometries when converting to WKB. - Expanded tests in
test_match_geopandas_series.pyandtest_geoseries.pyfor the new properties and addedLinearRingimports.
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 | Added loops testing .is_valid and .is_empty; imported LinearRing. |
| python/tests/geopandas/test_geoseries.py | Expanded unit tests for .is_valid, .is_empty, .is_simple; added LinearRing import. |
| python/sedona/geopandas/geoseries.py | Updated WKB conversion to handle None; implemented is_valid, is_empty, is_simple. |
Comments suppressed due to low confidence (3)
python/sedona/geopandas/geoseries.py:347
- [nitpick] In the docstring examples, import
GeoSeriesfromsedona.geopandasrather than referencinggeopandas.GeoSeriesto avoid confusion.
>>> from shapely.geometry import Polygon
python/tests/geopandas/test_match_geopandas_series.py:299
- Wrap
geomin a list when constructingGeoSeries(e.g.,GeoSeries([geom])) so that it’s treated as a sequence rather than attempting to iterate over the geometry itself.
sgpd_result = GeoSeries(geom).is_valid
python/tests/geopandas/test_match_geopandas_series.py:309
- Wrap
geomin a list when constructingGeoSeries(e.g.,GeoSeries([geom])) so that it’s treated as a sequence rather than attempting to iterate over the geometry itself.
sgpd_result = GeoSeries(geom).is_empty
Kontinuation
pushed a commit
to Kontinuation/sedona
that referenced
this pull request
Jan 21, 2026
…_simple (apache#2026) * Support elements of None type in GeoSeries * Implement test_is_valid * Implement is_empty * Implement is_simple
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: Implementis_valid,is_empty,is_simple#2025What changes were proposed in this PR?
Implement is_valid and is_empty
How was this patch tested?
Added tests
Did this PR include necessary documentation updates?