5

Let's say I have a GeoDataFrame with a CRS set.

gdf.crs

gives me

<Projected CRS: EPSG:25833>
Name: ETRS89 / UTM zone 33N
Axis Info [cartesian]:
- [east]: Easting (metre)
- [north]: Northing (metre)
Area of Use:
- undefined
Coordinate Operation:
- name: UTM zone 33N
- method: Transverse Mercator
Datum: European Terrestrial Reference System 1989
- Ellipsoid: GRS 1980
- Prime Meridian: Greenwich

This is of type <class 'pyproj.crs.crs.CRS'>. Is there a way to extract the EPSG Code from this, thus 25833?

Dima Chubarov
  • 16,199
  • 6
  • 40
  • 76
four-eyes
  • 10,740
  • 29
  • 111
  • 220

1 Answers1

10

.crs returns a pyroj.CRS object. This should get you the EPSG code from the object:

gdf.crs.to_epsg()

pyproj docs

DNy
  • 742
  • 1
  • 6
  • 15