Wednesday, 12 December 2018

How to shift a raster in QGIS?



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 ArcGIS' Shift tool 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.



Answer



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, x=1, y=-1)

Edit: Updated the link


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...