In Python, using GDAL, I've extracted a raster's projection as a WKT string as follows:
wkt = dataset.GetProjection()
# wkt is 'PROJCS["GDA_1994_Transverse_Mercator",GEOGCS["GDA_1994",DATUM["GDA_1994",SPHEROID["GRS_1980",6378137,298.2572221010002],TOWGS84[0,0,0,0,0,0,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["Meter",1]]'
Using the WKT string, I can create a SpatialReference instance as follows:
src = osr.SpatialReference()
src.ImportFromWkt(wkt)
This is easy-peasy. I can extract several parameters of the projection from src
such as the UTM zone, etc., easily enough. But I can't figure out how to extract something like the name of the projection, i.e. "GDA_1994_Transverse_Mercator"
. This has surely got to be possible, but the Python API documentation may as well be nonexistent for all the use it is.
How do I extract the names of the projection and the geographic coordinate system?