Skip to content

[SEDONA-720] Refactor GeoPandas Dataframe implementation#1916

Merged
jiayuasu merged 4 commits into
apache:masterfrom
zhangfengcdt:sedona-720-geopandas-refactor-df
Apr 12, 2025
Merged

[SEDONA-720] Refactor GeoPandas Dataframe implementation#1916
jiayuasu merged 4 commits into
apache:masterfrom
zhangfengcdt:sedona-720-geopandas-refactor-df

Conversation

@zhangfengcdt
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?

This PR refactor the GeoDataFrame python wrapper so that the code can be simplified, e.g.,

    def area(self) -> "GeoDataFrame":
        """
        Returns a GeoDataFrame containing the area of each geometry expressed in the units of the CRS.

        """
        return self._process_geometry_columns("ST_Area", rename_suffix="_area")


    def buffer(
        self,
        distance,
        resolution=16,
        cap_style="round",
        join_style="round",
        mitre_limit=5.0,
        single_sided=False,
        **kwargs,
    ) -> "GeoDataFrame":
        """
        Returns a GeoDataFrame with all geometries buffered by the specified distance.
        """
        return self._process_geometry_columns("ST_Buffer", rename_suffix="_buffered", distance=distance)

How was this patch tested?

test_geodataframe

Did this PR include necessary documentation updates?

  • No, this PR does not affect any public API so no need to change the documentation.

@zhangfengcdt zhangfengcdt marked this pull request as ready for review April 12, 2025 02:28
@zhangfengcdt zhangfengcdt requested a review from jiayuasu as a code owner April 12, 2025 02:28
@jiayuasu jiayuasu added this to the sedona-1.8.0 milestone Apr 12, 2025
@jiayuasu jiayuasu merged commit 7bf5274 into apache:master Apr 12, 2025
25 checks passed
Kontinuation pushed a commit to Kontinuation/sedona that referenced this pull request Jan 21, 2026
* [SEDONA-720] Refactor GeoPandas Dataframe implementation

* fix pre-commit error

* fix pyupgrade lint
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.

2 participants