<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
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>> From: even.rouault@mines-paris.org<br>> To: gdal-dev@lists.osgeo.org<br>> Subject: Re: [gdal-dev] Help understanding GDALApplyGeoTransform and        GDALInvGeoTransform<br>> Date: Fri, 31 Jul 2009 20:20:46 +0200<br>> CC: BCassanova@weather.com<br>> <br>> Bill,<br>> <br>> that's weird. Your code looks correct and I've just compiled it and I get the <br>> following results :<br>> <br>> lat-lon -127, 51<br>> 7.24754e-13, 4.12115e-13<br>> <br>> The new_x, new_y values are almost 0 as expected (the small difference is due <br>> to numerical imprecision when computing the inverse geotransform).<br>> <br>> I can't understand why you get such wrong values.<br>> <br>> Le Friday 31 July 2009 19:56:39 Cassanova, Bill, vous avez écrit :<br>> > double adfGeoTransform[6] = { -127, .011571482, 0, 51, 0, -.008993 };<br>> ><br>> > double adfReverseGeoTransform[6] = { 0, 0, 0, 0, 0, 0 };<br>> ><br>> > GDALInvGeoTransform( adfGeoTransform, adfReverseGeoTransform );<br>> ><br>> > double dfPixel = 0;<br>> > double dfLine = 0;<br>> > double x;<br>> > double y;<br>> ><br>> > GDALApplyGeoTransform( adfGeoTransform, dfPixel, dfLine, &x, &y );<br>> ><br>> > std::cout << "lat-lon " << x << ", " << y << std::endl;<br>> ><br>> > double new_x;<br>> > double new_y;<br>> ><br>> > GDALApplyGeoTransform( adfReverseGeoTransform, x, y, &new_x, &new_y );<br>> ><br>> > std::cout << new_x << ", " << new_y << std::endl;<br>> <br>> <br>> _______________________________________________<br>> gdal-dev mailing list<br>> gdal-dev@lists.osgeo.org<br>> http://lists.osgeo.org/mailman/listinfo/gdal-dev<br><br /><hr />More storage. Better anti-spam and antivirus protection. <a href='http://go.microsoft.com/?linkid=9671352' target='_new'>Hotmail makes it simple.</a></body>
</html>