Feature request #15842
More robust support for rotated rasters
|Pull Request or Patch supplied:||No||Resolution:|
|Easy fix?:||No||Copied to github as #:||23760|
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):
- 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.