<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"OCR A Extended";
        panose-1:2 1 5 9 2 1 2 1 3 3;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"OCR A Extended";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"OCR A Extended";
color:#1F497D'>I must have been doing something like that.  I got frustrated
and started from scratch and am now getting the correct results.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"OCR A Extended";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"OCR A Extended";
color:#1F497D'>Thank you guys help immensely.  GDAL is great but the learning
curve is a bit steep at times.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"OCR A Extended";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
gdal-dev-bounces@lists.osgeo.org [mailto:gdal-dev-bounces@lists.osgeo.org] <b>On
Behalf Of </b>Belaid MOA<br>
<b>Sent:</b> Friday, July 31, 2009 4:04 PM<br>
<b>To:</b> gdal-dev@lists.osgeo.org<br>
<b>Subject:</b> RE: [gdal-dev] Help understanding GDALApplyGeoTransform
andGDALInvGeoTransform<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:10.0pt;
font-family:"Verdana","sans-serif"'>Just out of curiosity, I ran your code on
my machine and I got exactly the same results as Even.<br>
I do not think that Endianity will cause such wrong results. Are you sure you
are not changing the values<br>
of new_x and new_y before printing them out?<br>
<br>
~Belaid.<br>
<br>
&gt; From: even.rouault@mines-paris.org<br>
&gt; To: gdal-dev@lists.osgeo.org<br>
&gt; Subject: Re: [gdal-dev] Help understanding GDALApplyGeoTransform and
GDALInvGeoTransform<br>
&gt; Date: Fri, 31 Jul 2009 20:20:46 +0200<br>
&gt; CC: BCassanova@weather.com<br>
&gt; <br>
&gt; Bill,<br>
&gt; <br>
&gt; that's weird. Your code looks correct and I've just compiled it and I get
the <br>
&gt; following results :<br>
&gt; <br>
&gt; lat-lon -127, 51<br>
&gt; 7.24754e-13, 4.12115e-13<br>
&gt; <br>
&gt; The new_x, new_y values are almost 0 as expected (the small difference is
due <br>
&gt; to numerical imprecision when computing the inverse geotransform).<br>
&gt; <br>
&gt; I can't understand why you get such wrong values.<br>
&gt; <br>
&gt; Le Friday 31 July 2009 19:56:39 Cassanova, Bill, vous avez écrit&nbsp;:<br>
&gt; &gt; double adfGeoTransform[6] = { -127, .011571482, 0, 51, 0, -.008993 };<br>
&gt; &gt;<br>
&gt; &gt; double adfReverseGeoTransform[6] = { 0, 0, 0, 0, 0, 0 };<br>
&gt; &gt;<br>
&gt; &gt; GDALInvGeoTransform( adfGeoTransform, adfReverseGeoTransform );<br>
&gt; &gt;<br>
&gt; &gt; double dfPixel = 0;<br>
&gt; &gt; double dfLine = 0;<br>
&gt; &gt; double x;<br>
&gt; &gt; double y;<br>
&gt; &gt;<br>
&gt; &gt; GDALApplyGeoTransform( &nbsp; adfGeoTransform, dfPixel, dfLine,
&amp;x, &amp;y );<br>
&gt; &gt;<br>
&gt; &gt; std::cout &lt;&lt; &quot;lat-lon &quot; &lt;&lt; x &lt;&lt; &quot;,
&quot; &lt;&lt; y &lt;&lt; std::endl;<br>
&gt; &gt;<br>
&gt; &gt; double new_x;<br>
&gt; &gt; double new_y;<br>
&gt; &gt;<br>
&gt; &gt; GDALApplyGeoTransform( &nbsp; adfReverseGeoTransform, x, y,
&amp;new_x, &amp;new_y );<br>
&gt; &gt;<br>
&gt; &gt; std::cout &lt;&lt; new_x &lt;&lt; &quot;, &quot; &lt;&lt; new_y
&lt;&lt; std::endl;<br>
&gt; <br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; gdal-dev mailing list<br>
&gt; gdal-dev@lists.osgeo.org<br>
&gt; http://lists.osgeo.org/mailman/listinfo/gdal-dev<o:p></o:p></span></p>

<div class=MsoNormal align=center style='text-align:center'><span
style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>

<hr size=2 width="100%" align=center>

</span></div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>More
storage. Better anti-spam and antivirus protection. <a
href="http://go.microsoft.com/?linkid=9671352" target="_new">Hotmail makes it
simple.</a><o:p></o:p></span></p>

</div>

</body>

</html>