[GIS] Setting CRS to ESRI:102001 using GeoPandas

coordinate systemgeopandaspyprojpython

I've been passed some GeoJSON shape data that I've been told is in the CRS ESRI:102001, although that property has not been written into the GeoJSON file. I've been able to confirm that is the correct CRS by converting it to EPSG:4326 using Python GDAL:

ds = gdal.VectorTranslate(input_file, srcDS=srcDS, srcSRS='ESRI:102001', dstSRS='EPSG:4326', format = 'GeoJSON', layerCreationOptions = ['RFC7946=YES', 'WRITE_BBOX=YES'])

I'd prefer to do the same in GeoPandas as I'm already using that for other tasks, while I'm only using GDAL for this one step. I've had a few goes at setting the CRS with no luck so far. This was my first effort:

inputGDF.crs = {'init' :'esri:102001'}
output_wgs84_GDF = inputGDF.to_crs("epsg:4326")

This fails on the 2nd line, with error:

pyproj.exceptions.CRSError: Invalid projection: +init=esri:102001 +type=crs: (Internal Proj Error: proj_create: cannot expand +init=esri:102001 +type=crs)

My second effort came from the proj4 info from:

https://spatialreference.org/ref/esri/102001/proj4/

inputGDF.crs = {'init' :'+proj=aea +lat_1=50 +lat_2=70 +lat_0=40 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs'}
output_wgs84_GDF = inputGDF.to_crs('epsg:4326')

This throws a similar error:

pyproj.exceptions.CRSError: Invalid projection: +init=proj=aea +lat_1=50 +lat_2=70 +lat_0=40 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs +type=crs: (Internal Proj Error: proj_create: cannot expand +init=proj=aea +lat_1=50 +lat_2=70 +lat_0=40 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs +type=crs)

Am I missing something?

Best Answer

The +init= syntax is deprecated. So all you need is the ESRI:102001 part. See: https://pyproj4.github.io/pyproj/stable/gotchas.html#init-auth-auth-code-should-be-replaced-with-auth-auth-code

inputGDF.crs = 'esri:102001'
Related Question