Skip to content

[GH-3281] GeoPandas: implement from_features - #3282

Merged
jiayuasu merged 1 commit into
apache:masterfrom
jiayuasu:feature/geopandas-from-features
Aug 26, 2026
Merged

[GH-3281] GeoPandas: implement from_features#3282
jiayuasu merged 1 commit into
apache:masterfrom
jiayuasu:feature/geopandas-from-features

Conversation

@jiayuasu

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 [GH-XXX] my subject.

Closes #3281.
Part of #2230.

What changes were proposed in this PR?

This PR implements GeoDataFrame.from_features for small, in-memory GeoJSON-like feature collections.

It:

  • delegates feature parsing to the installed GeoPandas version and wraps the resulting frame in Sedona;
  • accepts feature iterables and generators, FeatureCollection dictionaries, and objects implementing __geo_interface__;
  • preserves column selection and ordering, CRS assignment, null geometries, uneven or null property sets, and empty inputs with explicit columns;
  • preserves leading-null geometry order on Spark 3, where pandas-on-Spark otherwise fails Geometry UDT inference; and
  • documents driver materialization, Spark property-schema constraints, and the distributed GeoJSON and GeoParquet alternatives for large datasets.

Malformed inputs continue to use GeoPandas validation and error behavior. Property values must be representable by a consistent Spark-inferred schema after parsing.

How was this patch tested?

  • Spark 3.4.0 / Python 3.8 / GeoPandas 0.13.2: 3 focused tests passed.
  • Spark 3.4.0 / Python 3.8 / Shapely 1.8.5.post1: 3 focused tests passed.
  • Spark 4.1.1 / Python 3.11 / GeoPandas 1.1.3: 3 focused tests passed.
  • All commit hooks passed.

The tests cover supported input forms, generators, __geo_interface__, leading-null geometries, uneven and null properties, column ordering, CRS preservation, restored row order, and empty inputs with an explicit geometry schema.

Did this PR include necessary documentation updates?

The method documentation marks the API as added in 2.0.0, and the release notes are updated.

@jiayuasu jiayuasu added this to the sedona-2.0.0 milestone Aug 26, 2026
@jiayuasu
jiayuasu merged commit 9b56c3b into apache:master Aug 26, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GeoPandas: implement GeoDataFrame.from_features

1 participant