[gdal-dev] OSR Python: SR.ImportFromEPSG(4326), SR.ImportFromESRI(strPrj) return null values
David Verbyla
dlverbyla at alaska.edu
Sun Dec 16 05:30:06 PST 2012
I am a newbie to OGR/OSR using Python 2.7.2, please excuse my ignorance:
I'm having problems creating spatial reference using either .ImportFromEPSG
or .ImportFromESRI(prjfile string).
Yet .SetWellKnownGeogCS works fine.
from osgeo import ogr
import osr,os
testSR = osr.SpatialReference()
testSR.SetWellKnownGeogCS("WGS84")
print testSR.ExportToPrettyWkt()
#returns
#GEOGCS["WGS 84",
# DATUM["WGS_1984",
#....and so on...
testSR.ImportFromEPSG(4326)#returns 6
print testSR.ExportToPrettyWkt() #returns zero length string
prjFile = open('c:/test/GCS_WGS84.prj')
strPrj = prjFile.readline() #returns string with len 145
testSR.ImportFromESRI(strPrj)#returns 5
print testSR.ExportToPrettyWkt() #returns zero length string
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20121216/f55beb7f/attachment.html>
More information about the gdal-dev
mailing list