Even after rotating a GeoTIFF file, the resulting file size do not change. however, the rotated file overlays on the original TIFF file. When I tried gdal_translate with projwin switch an error occured:

ERROR 1: The -projwin option was used, but the geotransform is rotated. This configuration is not supported.

I am using GDAL 2.4.

  • I want to create a separate tiff for the rotated image. – Sharmistha Mar 7 '19 at 7:35
  • Please do not comment on your own question. Instead, Edit it to make clarifications. – Vince Mar 7 '19 at 13:22

SetGeoTransform() does not rotate the image. It effectively just tells a conformant viewer which way north is (and not all viewers are conformant). So, if you have an image where East is up (for example), the geotransform is used to say that each step along the scanline is a step South and one pixel down from the top of the image is a step West (in this example).

gdal_translate will take this geotransform with it to the new file, but it still won't be actually rotated. The -projwin option is not for rotating either but for selecting a subwindow. You want to use gdal_warp which will account for the geotransform as it resamples the image and thereby burn the rotation into the new output file (as per your comment below the original post).

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