1

I would like to overlap 2 raster files(.JP2/ECW) where images are captured from the same place but just with a little time difference. When I try to overlap the images by moving and rotating, QGIS rotates the whole canvas, so I could not move or rotate single raster layer. I tried the folllowing python code for this job:

from osgeo import gdal, osr

layer = iface.activeLayer()
provider = layer.dataProvider()
path = provider.dataSourceUri()
dataset = gdal.Open(path)

geotransform = dataset.GetGeoTransform()
gt = list(geotransform)
gt[0] = 500
gt[3]  = 500
gt[2] = 3 #x pixel rotation
gt[4] = 3 #y pixel rotation

dataset.SetGeoTransform(tuple(gt))

dataset = None

but it does not update the current map on the canvas.

  • Are the images georeferenced? – Shub Jul 14 '17 at 15:16
  • No they are not – Bhoke Jul 16 '17 at 16:41
  • Try using the Print Composer to bring the two images in – Shub Jul 18 '17 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.