[GIS] way to erase GeoTIFF header

coordinate systemgeotiff-tiff

I've got some GeoTIFF files that have wrong bounding box extent and wrong CRS associated to.

Fortunately I know the right CRS, but even associating it to the files (I've tried both with QGIS and ArcCatalog) their extent remains the wrong one.

So I was wondering if there's a way to completely erase the GeoTIFF header file, then assigning the CRS and obtaining the correct bounding box.

Best Answer

Building on Garrett Hall suggestion, you can use gdal_translate, and a GeoTIFF format specific setting that prevents GDAL from writing any GeoTIFF tags to the output file. If the georeferencing information is stored externally to the original file as a world file then it can be easily applied to the new corrected TIF.

This assumes that you have QGIS installed and is written from a MS Windows standpoint:

  1. Open a OSGeo4W command prompt - this should be found under the Quantum GIS start menu folder with a shortcut called 'OSGeo4W'
  2. Enter the following command at the prompt. You can copy and paste, but note that the Ctrl+v shortcut doesn't work on the command prompt, you have to right click instead.

    gdal_translate -co PROFILE=BASELINE ProblematicTIF CorrectedTIF

Replacing ProblematicTIF with the full path to your problematic TIF file, enclosed in double quotes, and CorrectedTIF with the full path to the corrected file that will be created, again in double quotes (there's no option to overwrite with this method unfortunately, a new file has to be created).

An example would be:

gdal_translate -co PROFILE=BASELINE "C:\GeoRefencing\Highfield_Campus.tif" "C:\GeoRefencing\Highfield_Campus_corrected.tif"
Related Question