GeoDataFrame.
set_geometry
Set the GeoDataFrame geometry using either an existing column or the specified input. By default yields a new object.
The original geometry column is replaced with the input.
Delete column to be used as the new geometry
Modify the GeoDataFrame in place (do not create a new object)
Coordinate system to use. The value can be anything accepted by pyproj.CRS.from_user_input(), such as an authority string (eg “EPSG:4326”) or a WKT string. If passed, overrides both DataFrame and col’s crs. Otherwise, tries to get crs from passed col values or DataFrame.
pyproj.CRS.from_user_input()
Examples
>>> df1 = df.set_geometry([Point(0,0), Point(1,1), Point(2,2)]) >>> df2 = df.set_geometry('geom1')