15

I'm looking for a tool or a plug-in for QGIS that would allow me to shift rasters to new coordinates. An equivalent of "Shift" tool in ArcGIS would be the best option.

I know I can edit the world file that comes along with the raster to do this, but some raster formats (like GeoTIFF) contain their metadata inside their binary format.

Taras
  • 32,823
  • 4
  • 66
  • 137
pg85
  • 684
  • 1
  • 5
  • 14
  • A python solution can be found here: http://gis.stackexchange.com/questions/80774/how-to-translate-reposition-a-tif-raster-layer and http://gis.stackexchange.com/questions/13561/how-to-translate-reposition-a-raster-in-python – AndreJ Jan 26 '15 at 12:10

4 Answers4

10

The Rasmover plugin should do what you want.

You have to allow for experimental plugins to get it in the plugin list.

The result is a virtual raster file, which you can edit with a text editor to adjust the parameters if needed.

AndreJ
  • 76,698
  • 5
  • 86
  • 162
  • Thanks, it's not exactly what I had in mind, but this actually works. You can later save the edited vrt as a normal, standalone raster. I wish this plugin had a dialog window where you could input new coordinates. – pg85 Jan 28 '15 at 07:56
7

I just used this in R and it solved the problem.

Page 195 from https://cran.r-project.org/web/packages/raster/raster.pdf (use table of contents for quick access)

r <- raster()
r <- shift(r, dx=1, dy=-1)

Edit 1: Updated the link

Edit 2: Updated for package changes in 2.9-22 (https://github.com/rspatial/raster/issues/66)

hfisch
  • 585
  • 1
  • 8
  • 27
dTanMan
  • 94
  • 1
  • 2
7

For this job I am satisfied with QGIS plugin Freehand Raster Georeferencer. Allows these simple operations in an user friendly GUI: Move, Rotate, Scale, Adjust sides, 2 Points referencer.

Final export consists of three files: TIF, WorldFile (.tfw) and additional information (e.g. projection, etc.) into auxiliary file (.aux.xml).

I usually merge three files into a GeoTIFF e.g. with GDAL. I also strongly recommend to apply some compression method (the result from the Plugin is uncompressed), e.g.

gdal_translate -of GTiff -co COMPRESS=DEFLATE input.tif output.tif

jurajb
  • 1,204
  • 11
  • 17
4

Besides the already existing answers, it can be done with gdal_translate, using the command line option a_ullr (see documentation).

With a_ullr you can specify the new upper-left and lower-right coordinates of the raster, so for example if the raster extent as seen in "Properties" is "100,400:300,200", then to shift by +1 unit in x and +2 units in y the command becomes:

gdal_translate -a_ullr 101 402 301 202 input.tif output.tif

gdal_translate can be accessed from the QGIS processing pane and "-a_ullr 101 402 301 202" can be input under "Additional command line arguments".

The method was previously described in "Applying a simple X,Y shift or translation to a raster GeoTIFF file using GDAL ".

Taras
  • 32,823
  • 4
  • 66
  • 137
Marcel
  • 176
  • 6