Sunday, 25 March 2018

How to reproject a raster file in QGIS with datum transformation?


I want to reproject a tiff raster file from projection A (ETRS89/UTM Zone 32) to projection B (DHDN/Gauss-Kruger zone 2). The two projections have a different datum so I have to use a datum transformation (NTv2 BETa2007 in my case). I want to create a new raster file with projection B because I want to use it in another software. So reprojection on-the-fly is not what I need.



I have tried Raster > Transform (or similar - I do not know the English menu) but I can not see how to define a datum transformation here.


How can I do a permanent reprojection of a raster file in Qgis with a datum transformation?



Answer



Gdalwarp is the tool to reproject, you find it in Qgis under Raster->Projektionen->Transformieren or standalone in OSGEO4W.


Basic command is


gdalwarp -s_srs EPSG:25832 -t_srs "+proj=tmerc +lat_0=0 +lon_0=6 +x_0=2500000 +y_0=0 +k=1.000000 +ellps=bessel +units=m +nadgrids=./BETA2007.gsb +wktext" input.tif output.tif

BETA2007.gsb should be in the same folder, or use absolute path to it.


In Qgis, select the loaded tif as input, and its CRS, and paste the following in the target-CRS:


+proj=tmerc +lat_0=0 +lon_0=6 +x_0=2500000 +y_0=0 +k=1.000000 +ellps=bessel +units=m +nadgrids=D:\path\to\your\BETA2007.gsb +wktext

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...