geopandas.GeoDataFrame.set_crs

GeoDataFrame.set_crs(self, crs=None, epsg=None, inplace=False, allow_override=False)

Set the Coordinate Reference System (CRS) of the GeoDataFrame.

If there are multiple geometry columns within the GeoDataFrame, only the CRS of the active geometry column is set.

NOTE: The underlying geometries are not transformed to this CRS. To transform the geometries to a new CRS, use the to_crs method.

Parameters
crspyproj.CRS, optional if epsg is specified

The value can be anything accepted by pyproj.CRS.from_user_input(), such as an authority string (eg “EPSG:4326”) or a WKT string.

epsgint, optional if crs is specified

EPSG code specifying the projection.

inplacebool, default False

If True, the CRS of the GeoDataFrame will be changed in place (while still returning the result) instead of making a copy of the GeoDataFrame.

allow_overridebool, default False

If the the GeoDataFrame already has a CRS, allow to replace the existing CRS, even when both are not equal.