<div dir="ltr">Hi Jean-Claude, <br>Thanks for your answer ! <br><br>I would like still to find some things which are not clear to me. Any help would be appreciated. <br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Since the horizontal resolution is 1483m/pixel and the vertical resolution is 1391m/pixel, it is obvious that your cells are not square !<br>
</blockquote></div><br><br clear="all">Hi Jean, <br>Thanks for your message. Well if that's the case then the error notice in the code should be changed, imho. <br>Since the error says: <br><pre class="fragment"> <span class="stringliteral">"of CELLSIZE since the input pixels are non-square. </span></pre>
But the pixels them selves are square ! Just the whole tiff itself has a non square resolution. <br><pre class="fragment"> adfGeoTransform[0] <span class="comment">/* top left x */</span><br> adfGeoTransform[1] <span class="comment">/* w-e pixel resolution */</span><br>
adfGeoTransform[2] <span class="comment">/* rotation, 0 if image is "north up" */</span><br> adfGeoTransform[3] <span class="comment">/* top left y */</span><br> adfGeoTransform[4] <span class="comment">/* rotation, 0 if image is "north up" */</span><br>
adfGeoTransform[5] <span class="comment">/* n-s pixel resolution */</span><br><br><br>following the python api tutorial here <a href="http://www.gdal.org/gdal_tutorial.html">http://www.gdal.org/gdal_tutorial.html</a><br>
I understood that my pixel size is 1 by 1. <br>So the differnce is:<br> the C++ is looking at the X-Y resolution and call is pixel size ?<br>Whereas in the python tutorial, called this the ,dataSource.RasterXSize ,<br>dataSource.RasterYSize.</pre>
<br>>>> dataSource = gdal.Open('area_of_interest.tif')<br>>>> geotransform = dataSource.GetGeoTransform()<br>>>> print 'Pixel Size = (',geotransform[1], ',',geotransform[5],')'<br>
Pixel Size = ( 1.0 , -1.0 )<br>>>> print 'Origin = (',geotransform[0], ',',geotransform[3],')'<br>Origin = ( 3366307.0 , 5814845.0 )<br>>>> print 'Size is ',dataSource.RasterXSize,'x',dataSource.RasterYSize, 'x',dataSource.RasterCount<br>
Size is 1483 x 1391 x 1<br><br>Also, one more thing I noticed, <br>when I convert the tiff to resized tiff, this error is not raised ! <br><br><br>Oz Nahum<br>Graduate Student<br>Zentrum für Angewandte Geologie<br>Universität Tübingen<br>
<br>---<br><br>Imagine there's no countries<br>it isn't hard to do<br>Nothing to kill or die for<br>And no religion too<br>Imagine all the people<br>Living life in peace <br><br><br>
</div>