to_gdf

Contents

to_gdf#

to_gdf(any_gpd_type: GeoDataFrame | GeoSeries) GeoDataFrame[source]#

Converts a GeoPandas object to a GeoDataFrame.

This function accepts either a GeoDataFrame or GeoSeries and ensures that the output is always a properly formatted GeoDataFrame. If the input is a GeoSeries, it is wrapped into a GeoDataFrame with the same geometry and coordinate reference system (CRS).

Parameters:

any_gpd_type (gpd.GeoDataFrame | gpd.GeoSeries) – A GeoPandas object, either a GeoDataFrame or GeoSeries, to be converted into a GeoDataFrame.

Returns:

A validated GeoDataFrame derived from the input GeoPandas object.

Return type:

gpd.GeoDataFrame