0

I have an aerial image that already has geo-spatial information (already georeferenced), but the original georeferenced location is very rough (not accurate). I wanted to create ground control points and georeference the image again to a more accurate location. Do I have to remove the spatial information of the original image and make it as a raw image first? Or can İ make GCPs directly on the original image (which is already georeferenced)?

3
  • Can you use GDAL tools?
    – user30184
    Nov 23 '21 at 12:27
  • İ made GCPs using QGİS Georeferencer tool. It worked . İt produced a new georeferenced map.. But the GCPs table is very strange. It treats the original image as a map but not arrays of pixels. But when İ used the same GCPs table in GDAL command line, it gave me an error image.
    – Bonnie
    Nov 23 '21 at 12:34
  • Sorry, I do not understand what you mean with arrays of pixels. The QGIS georeferencer sets negative values for the pixel Y coordinates, they must be turned positive for GDAL -gcp.
    – user30184
    Nov 23 '21 at 12:45
1

Already georeferenced image can be georeferenced with QGIS georeferencer without removing old georeference info first. However, georeferencer does not update the old image but it writes out a new image.

It is also possible to update the georeference of the image without writing the pixels again but in this case the old georeference information must be wiped first for example with gdal_edit utility https://gdal.org/programs/gdal_edit.html. It is a Python script and therefore GDAL Python bindings must be installed on the computer. Usage:

gdal_edit -unsetgt image.tif

This works if GDAL is installed with OSGeo4W but otherwise it may be necessary to run the script as

python [path_to]gdal_edit.py -unsetgt image.tif

New ground control points can be added to the image with the same gdal_edit utility.

If GDAL Python utilities are not available and QGIS georeferencer does not feel like the best tool it is also possible to make a clean copy of the image with gdal_translate:

gdal_translate -of GTiff -co profile=baseline --config GDAL_PAM_ENABLED NO  input.tif clean_out.tif

In the command the config option --config GDAL_PAM_ENABLED NO prevents writing of an additional .aux.xml file that stores the georeferencing info and other metadata that was removed from the GeoTIFF. That may have an affect on further processing. Instead of using the config option it is also possible just to delete the .aux.xml file.

2
  • Thank you very much! So is it theoretically not correct to re-georeference a GeoTif image? I have to remove the georeference information prior to making GCPs?
    – Bonnie
    Nov 23 '21 at 12:55
  • You can open already georeferenced image with QGIS georeferencer, measure new ground control points and run the process that creates a new image. In this scenario you can use the GeoTIFF as-is. If you want to fix the existing image without creating a copy you must delete the old georeference and add more accurate ground control points with gdal_edit. QGIS georeferencer does not overwrite but you can use it for measuring the gcps for GDAL tools.
    – user30184
    Nov 23 '21 at 13:41

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.