[GH-3357] GeoPandas: implement list_layers for GeoPackage - #3358
Open
jiayuasu wants to merge 1 commit into
Open
Conversation
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?
Yes, I have read the Contributor Rules and Contributor Development Guide.
Is this PR related to a ticket?
Closes #3357. Part of #2230.
What changes were proposed in this PR?
Add
sedona.spark.geopandas.list_layers(filename)for a single GeoPackage. It returns a pandas DataFrame withnameandgeometry_type, sorted by name. Empty vector layers and registered nonspatial tables are included; raster tiles are excluded.The implementation uses the existing Sedona GeoPackage reader, with no Pyogrio dependency or feature-geometry scan. A new
includeGeometryType=trueoption extendsshowMetadata=true; the default ten-column schema and existing reader behavior remain unchanged. The opt-in mode rejects paths resolving to multiple files instead of silently using the first file.Declared core geometry types include optional Z; M is not represented in the label, and generic geometry reports
Unknown. Malformed feature metadata fails. JDBC resources and staged files are cleaned up, and remote staging avoids leftover Hadoop checksum sidecars.This version supports
.gpkgstring/path-like inputs only. Remote inputs use Hadoop filesystem configuration and still require copying the entire file to executor-local temporary storage.How was this patch tested?
pytest -q tests/geopandas/test_io.py -k 'TestListLayers or read_geopackage': 34 passed each on PySpark 3.5.8, 4.0.2 and 4.1.1, using the freshly built JARs.GeoPackageReaderTestmetadata, vector, raster and hidden-metadata selections: 22 passed each on Spark 3.5.0, 4.0.0 and 4.1.1. Includes JDBC cleanup and staging through a real Hadoop ViewFileSystem mount.git diff --checkpassed.All local runs used JDK 17. The Docker daemon is not running locally, so the MinIO/S3 test was not executed; its new metadata assertions and the remaining environment matrix are left to CI. The full repository suite was not run.
Did this PR include necessary documentation updates?
Yes. Added the API docstring for v2.0.0, GeoPackage reader documentation covering the option and limits, and a 2.0.0 release-note entry.