<div dir="ltr"><div class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">Greetings,</font></span></div>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">I am trying to transform XY coordinates using Python.<span style="mso-spacerun: yes"> </span>I am using Python 2.4.1 on Windows XP Professional Service Pack 3.<span style="mso-spacerun: yes"> </span>Here is the code I am using:</font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2"> </font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">from osgeo import osr</font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2"> </font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">#original SRS </font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">sourceSR = osr.SpatialReference() </font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">sourceSR.ImportFromEPSG(26712) #utm nad27 12n</font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">#target SRS </font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">targetSR= osr.SpatialReference() </font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">targetSR.ImportFromEPSG(4301) #stateplane nad83 Utah north zone</font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">#targetSR.ImportFromEPSG(26912)# utm nad 83 12n # Same results as (4301)</font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">coordTrans =osr.CoordinateTransformation(sourceSR,targetSR) </font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">x=423061.91 </font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">y=4524687.86</font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">res=coordTrans.TransformPoint(x,y)</font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">print 'x= %10.2f , y= %10.2f' % (res[0],res[1])</font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2"> </font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2"> </font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">I get x= -1.95, y= 0.71</font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">should be x = 196359.35 y = 1885770.43</font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2"> </font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">The error returned is " ERROR 1: failed to load NAD27-83 correction file".<span style="mso-spacerun: yes"> </span></font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2"> </font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">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.</font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">Added a System environment variable called PROJ_LIB with the value of C:\Program Files\proj\nad</font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2"> </font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">I am not sure what I have done wrong and was hoping someone could point me in the right direction.</font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2"> </font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2">Thanks</font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma"><font size="2"> </font></span></p><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"><font size="2">Lee Eschler</font> </span></div>