Created
January 2, 2013 16:37
-
-
Save hrwgc/4435920 to your computer and use it in GitHub Desktop.
WKT to Proj4 string GDAL python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from osgeo import osr | |
srs = osr.SpatialReference() | |
wkt_text = 'PROJCS["Transverse Mercator",GEOGCS["GCS_Everest_1830",DATUM["D_Everest_1830",SPHEROID["Everest_1830",6377299.36,300.8017]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500295.0],PARAMETER["False_Northing",-2000090.0],PARAMETER["Central_Meridian",90.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]' | |
srs.importFromWkt(wkt_text) | |
srs.ExportToProj4() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It should be
ImportFromWkt(wkt_text)
with a capital I.