Feature request #15842

More robust support for rotated rasters

Added by Mike Taves about 8 years ago. Updated over 7 years ago.

Status:Open
Priority:Normal
Assignee:-
Category:Rasters
Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:23760

Description

QGIS 2.18.0 does not correctly display or represent rasters with rotation terms in the affine transformation matrix. This is a dupe of #13998 (and maybe others?) but with more information on the issues.

For example, see attached test.tif, which has a 50 m grid size and is rotated 32° anticlockwise around the upper left corner. Here is what this raster should look like, as viewed with ArcGIS 10.3.1 (blue is the canvas background):

Here are the problems viewing the raster within QGIS 2.18.0 via OSGeo4W (blue is the canvas background):
  • The pixels themselves are not rotated, and remain horizontal. It is not apparent what the pixel values represent from the source dataset.
  • The filler pixels in each corner have values "0" (there are no "0" values in the source raster, and NODATA is 255). While this space is covered by a basic bounding box, it is outside the rotated raster footprint.
  • The Layer Properties describe the raster with different dimensions (Columns:7 Rows 7); see gdalinfo output below.
$ gdalinfo test.tif
Driver: GTiff/GeoTIFF
Files: test.tif
Size is 4, 6
Coordinate System is `'
GeoTransform =
  10000, 42.4024048078213, 26.49596321166025
  200000, 26.49596321166025, -42.4024048078213
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (   10000.000,  200000.000)
Lower Left  (   10158.976,  199745.586)
Upper Right (   10169.610,  200105.984)
Lower Right (   10328.585,  199851.569)
Center      (   10164.293,  199925.785)
Band 1 Block=4x6 Type=Byte, ColorInterp=Gray
  NoData Value=255

Looking at the Metadata, it is apparent that rotated rasters are internally represented with a VRT Virtual Raster having the same (unrotated) pixel size (e.g. 50 m). This feature request is to provide more robust support for rotated rasters that uses the affine transform to draw rasters as intended, and not a VRT Virtual Raster wrapper workaround.

test.tif (568 Bytes) Mike Taves, 2016-11-13 06:20 PM


Related issues

Duplicated by QGIS Application - Bug report #13998: QGIS is not rotating the Pixels when showing a rotated tif Closed 2015-12-16

History

#1 Updated by Giovanni Manghi over 7 years ago

  • Easy fix? set to No

#2 Updated by Giovanni Manghi over 5 years ago

  • Duplicated by Bug report #13998: QGIS is not rotating the Pixels when showing a rotated tif added

Also available in: Atom PDF