Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on a GDAL driver for a proprietary grid-format. In some cases, the grids are rotated in order to get smaller file sizes. In my GDAL geotransform array, I do the following (showing a hardcoded 30 degrees angle):

rot_deg = 30;
rotation = rot_deg * deg2rad;
poDS->dGeoTransform[0] = originX;
poDS->dGeoTransform[1] = cos(rotation) * cellSizeX;
poDS->dGeoTransform[2] = -sin(rotation) * cellSizeX;
poDS->dGeoTransform[3] = originY;
poDS->dGeoTransform[4] = sin(rotation) * cellSizeY;
poDS->dGeoTransform[5] = cos(rotation) * cellSizeY;

where originX and originY is the center of the corner cell.

In addition, I got an identical file in TIFF format, with same min/max + cell values.I then apply an ArcGis geotransform to the .tiff, rotating it 30 degrees aswell.

When adding both files as layers, the tiff is 100% correctly aligned to the pivot point, while my GDAL format is slightly displaced.

The screenshot shows the overlapping grids, with only the corner pixel visible. The cyan point is the pivot point. The dark pixel on top is the (correct) tiff, while the grey pixel beneath is from my own driver. The misalignment is the same over the whole grid.

Anybody got an idea what could be wrong ?

enter image description here

EDIT/update: In the ArcGis geotransform, it is possible to enter a pivot point, which is the case here (center of the corner cell). However, it seems like GDAL's geotransform is not expressive enough (?) to handle this, hence it uses the lower left corner.

share|improve this question
Does your EDIT/update mean that you now know the answer to your own question? If so, it is permissible for you to post an Answer and then Accept it. Also, I've assumed that when you refer to ArcGIS Geotransform you are looking at ArcObjects. – PolyGeo Sep 23 '13 at 7:11
up vote 0 down vote accepted

Forgot to answer this question: The GDAL geotransform matrix lacks the possibility to shift x/y directions (only scaling and rotation can be done).

The solution was to create a custom geomtransform in ArcObjects, which adds additional transformation parameters to the aux.xml file. The grid then rotated/shifted/scaled as dersired.

Unfortunately I don't have access to the code anymore, and can't provide sample code.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.