dask_geopandas.GeoDataFrame.rename_geometry#
- GeoDataFrame.rename_geometry(col)#
Renames the GeoDataFrame geometry column to the specified name. By default yields a new object.
This docstring was copied from geopandas.geodataframe.GeoDataFrame.rename_geometry.
Some inconsistencies with the Dask version may exist.
The original geometry column is replaced with the input.
- Parameters:
- colnew geometry column label
- inplaceboolean, default False (Not supported in Dask)
Modify the GeoDataFrame in place (do not create a new object)
- Returns:
- geodataframeGeoDataFrame
See also
GeoDataFrame.set_geometry
set the active geometry
Examples
>>> from shapely.geometry import Point >>> d = {'col1': ['name1', 'name2'], 'geometry': [Point(1, 2), Point(2, 1)]} >>> df = geopandas.GeoDataFrame(d, crs="EPSG:4326") >>> df1 = df.rename_geometry('geom1') >>> df1.geometry.name 'geom1' >>> df.rename_geometry('geom1', inplace=True) >>> df.geometry.name 'geom1'