Get PROJ.4 representation of CRS object


Denis Rykov
 

Hi folks! Is there a way to get a PROJ.4 representation of CRS object?

I've tried to use to_proj4() method:

from rasterio.crs import CRS
wkt = 'PROJCS["WGS 84 / UTM zone 5N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","32605"]]'
crs = CRS.from_wkt(wkt)
crs.to_proj4()

It returns: "+init=epsg:32605" but what I want to get is "+proj=utm +zone=5 +datum=WGS84 +units=m +no_defs". Is it possible?

Join main@rasterio.groups.io to automatically receive all group messages.