EPSG Code – How to Convert UTM Zone into EPSG Code

convertcoordinate systemepsgpythonutm

I have the UTM code 36S and want to convert it to EPSG.

Somebody told me that if the UTM code contains 'S', then the first three digits of the EPSG code are 327, and if the UTM code is 'N' then use 326 instead. And then you just append the UTM number (in this case 36) to get '327' + '36' => '32736'.

Does this always work? And should I be using some python library to do this for me?

Best Answer

Use pyproj (version 2.2+):

from pyproj import CRS

# use PROJ string, assuming a default WGS84
crs = CRS.from_string('+proj=utm +zone=36 +south')
# or dictionary
crs = CRS.from_dict({'proj': 'utm', 'zone': 36, 'south': True})

print(crs.to_authority())  # ('EPSG', '32736')