I must have been doing something like that. I got frustrated and started from scratch and am now getting the correct results.
Thank you guys help immensely. GDAL is great but the learning curve is a bit steep at times. From: [email protected] [mailto:[email protected]] On Behalf Of Belaid MOA Sent: Friday, July 31, 2009 4:04 PM To: [email protected] Subject: RE: [gdal-dev] Help understanding GDALApplyGeoTransform andGDALInvGeoTransform Just out of curiosity, I ran your code on my machine and I got exactly the same results as Even. I do not think that Endianity will cause such wrong results. Are you sure you are not changing the values of new_x and new_y before printing them out? ~Belaid. > From: [email protected] > To: [email protected] > Subject: Re: [gdal-dev] Help understanding GDALApplyGeoTransform and > GDALInvGeoTransform > Date: Fri, 31 Jul 2009 20:20:46 +0200 > CC: [email protected] > > Bill, > > that's weird. Your code looks correct and I've just compiled it and I get the > following results : > > lat-lon -127, 51 > 7.24754e-13, 4.12115e-13 > > The new_x, new_y values are almost 0 as expected (the small difference is due > to numerical imprecision when computing the inverse geotransform). > > I can't understand why you get such wrong values. > > Le Friday 31 July 2009 19:56:39 Cassanova, Bill, vous avez écrit : > > double adfGeoTransform[6] = { -127, .011571482, 0, 51, 0, -.008993 }; > > > > double adfReverseGeoTransform[6] = { 0, 0, 0, 0, 0, 0 }; > > > > GDALInvGeoTransform( adfGeoTransform, adfReverseGeoTransform ); > > > > double dfPixel = 0; > > double dfLine = 0; > > double x; > > double y; > > > > GDALApplyGeoTransform( adfGeoTransform, dfPixel, dfLine, &x, &y ); > > > > std::cout << "lat-lon " << x << ", " << y << std::endl; > > > > double new_x; > > double new_y; > > > > GDALApplyGeoTransform( adfReverseGeoTransform, x, y, &new_x, &new_y ); > > > > std::cout << new_x << ", " << new_y << std::endl; > > > _______________________________________________ > gdal-dev mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/gdal-dev ________________________________ More storage. Better anti-spam and antivirus protection. Hotmail makes it simple. <http://go.microsoft.com/?linkid=9671352>
_______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
