Greetings,

I am trying to transform XY coordinates using Python.  I am using Python
2.4.1 on Windows XP Professional Service Pack 3.  Here is the code I am
using:



from osgeo import osr



#original SRS

sourceSR = osr.SpatialReference()

sourceSR.ImportFromEPSG(26712) #utm nad27 12n

#target SRS

targetSR= osr.SpatialReference()

targetSR.ImportFromEPSG(4301) #stateplane nad83 Utah north zone

#targetSR.ImportFromEPSG(26912)# utm nad 83 12n # Same results as (4301)

coordTrans =osr.CoordinateTransformation(sourceSR,targetSR)

x=423061.91

y=4524687.86

res=coordTrans.TransformPoint(x,y)

print 'x= %10.2f , y= %10.2f' % (res[0],res[1])





I get x= -1.95, y= 0.71

should be x = 196359.35 y = 1885770.43



The error returned is " ERROR 1: failed to load NAD27-83 correction file".




I extracted the PROJ 4.4.6 WIN32 Binaries into my C:\Program Files
directory. Added C:\Program Files\proj\bin to the end of my System Path
environment variable.

Added a System environment variable called PROJ_LIB with the value of
C:\Program Files\proj\nad



I am not sure what I have done wrong and was hoping someone could point me
in the right direction.



Thanks


Lee Eschler
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to