<div dir="ltr"><div><div><div>I am currently working on a driver for a proprietary format, which is being consumed by ArcGis via GDAL.<br><br></div>These grids sometimes has a rotation with a specified pivot point. I managed to get ArcGis to display the rotated grid by doing the following: <br>
<br>poDS->dGeoTransform[0] = originX;<br>poDS->dGeoTransform[1] = cos(rotation) * cellSizeX;<br>poDS->dGeoTransform[2] = -sin(rotation) * cellSizeX;<br>poDS->dGeoTransform[3] = originY;<br>poDS->dGeoTransform[4] = sin(rotation) * cellSizeY;<br>
poDS->dGeoTransform[5] = cos(rotation) * cellSizeY;<br><br></div>Rotation is in radians. It works, but there is one problem: I need to rotate the grid around the center of the corner cell (originX, originY), but ends up getting rotation around the corner of the cell/raster instead.<br>
<br></div><div>There is a screenshot here, showing only the corner pixel. The topmost grid/pixel was translated using custom geotransform in ArcGis, the bottom one is the result of my GDAL rotation:<br>The cyan dot shows the pivot point:<br>
<br><a href="http://i.stack.imgur.com/7HEvc.png">http://i.stack.imgur.com/7HEvc.png</a><br></div><div></div><div><br><br></div>Is there any way to express this translation using the geotransform matrix ?<br></div>