Hi all,<div><br></div><div>I&#39;ve spent some time today working with the SetGeoTransform function today and want to mention that the documentation doesn&#39;t seem quite clear and maybe even a bit misleading.</div><div><br>

</div><div>In here, <a href="http://www.gdal.org/classGDALDataset.html#f9593cc241e7d140f5f3c4798a43a668">http://www.gdal.org/classGDALDataset.html#f9593cc241e7d140f5f3c4798a43a668</a>, the transform is mentioned as a 6 element matrix (2x3) and explains the elements as follows:</div>

<div><span class="Apple-style-span" style="font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 14px; "><br></span></div><i>&quot;In a north up image, padfTransform[1] is the pixel width, and padfTransform[5] is the pixel height. The upper left corner of the upper left pixel is at position (padfTransform[0],padfTransform[3]).&quot;</i><div>

<i><br></i></div><div>Additionally, in the tutorial,<a href="http://www.gdal.org/gdal_tutorial.html">http://www.gdal.org/gdal_tutorial.html</a>, it says:</div><div><span class="Apple-style-span" style="font-family: monospace, fixed; font-size: 14px; "><pre class="fragment" style="font-family: monospace, fixed; font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); background-color: rgb(245, 245, 245); margin-top: 4px; margin-bottom: 4px; margin-left: 2px; margin-right: 8px; padding-left: 6px; padding-right: 6px; padding-top: 4px; padding-bottom: 4px; ">

    adfGeoTransform[0] <span class="comment" style="color: rgb(128, 0, 0); ">/* top left x */</span>
    adfGeoTransform[1] <span class="comment" style="color: rgb(128, 0, 0); ">/* w-e pixel resolution */</span>
    adfGeoTransform[2] <span class="comment" style="color: rgb(128, 0, 0); ">/* rotation, 0 if image is &quot;north up&quot; */</span>
    adfGeoTransform[3] <span class="comment" style="color: rgb(128, 0, 0); ">/* top left y */</span>
    adfGeoTransform[4] <span class="comment" style="color: rgb(128, 0, 0); ">/* rotation, 0 if image is &quot;north up&quot; */</span>
    adfGeoTransform[5] <span class="comment" style="color: rgb(128, 0, 0); ">/* n-s pixel resolution */</span></pre></span></div><div><div><i><br></i></div><div>I believe these comments are not quite true and a little misleading.  Here is a common example of using SetGeoTransform where the above statement breaks down.</div>

<div><br></div><div>Suppose you have an imager that collects an image of the surface of the earth over a small, local area say 50m by 50m.  For ease, let each pixel represents a 10cm by 10cm box.  Now, say you have the image data in raster format and want to output a geotiff.  You will have to make a geo transform that maps from pixel space (in meters) to lat/lon space.  Additionally, your raster image is rotated by 10 degrees (denoted as alpha and in radians) East due to the imaging collection parameters.  The matrix you want is something like the following:</div>

<div><br></div><div>padfTransform[0] = corner lon</div><div><div>padfTransform[1] = cos(alpha)*(scaling)</div></div><div>padfTransform[2] = -sin(alpha)*(scaling)</div><div>padfTransform[3] = corner lat</div><div>padfTransform[4] = sin(alpha)*(scaling)</div>

<div><div>padfTransform[5] = cos(alpha)*(scaling)</div></div><div><br></div><div>where scaling maps pixel space to lat/lon space (see <a href="http://en.wikipedia.org/wiki/Geographical_distance#Spherical_Earth_projected_to_a_plane">http://en.wikipedia.org/wiki/Geographical_distance#Spherical_Earth_projected_to_a_plane</a> on how to compute the scaling factor)</div>

<div><br></div><div>See <a href="http://en.wikipedia.org/wiki/Transformation_matrix#Rotation">http://en.wikipedia.org/wiki/Transformation_matrix#Rotation</a> for more details on my matrix coefs.</div><div><br></div><div>
I think the documentation would be more clear if it included this description -- that matrix represents a combination of scaling, rotation, and transnational components of which most of the them are combined in the terms, not isolated as the documentation has the reader to believe.</div>

<div><br></div><div>Anyways, I&#39;m not griping, just trying to help.  GDAL&#39;s been very useful to my group and the community has been very responsive.  Thank you for this.</div><div><br></div><div>Isaac</div><div><div>

<br></div></div></div>