3

In short, the problem is that when Geoereferencer is reopened with a previously edited raster, all the previously saved control points have moved off the image to a location thousands of kilometres away. (QGIS 2.6, Windows 64 bit).

In Georeferencer, I create a number of GCPs (i.e. control points) by referencing to objects in the map canvas. After adding points, I start the georeferencing calculation. Operation is successful, the raster appears on the map canvas, along with the control points. The control points are also visible in the Georeferencer window, still overlying the points chosen for georeferencing. I save the control points and close the Georeferencer. All good so far.

Now for the problem. Having closed the Georeferencer, I reopen it, and open the new, georeferenced, raster image. But now, the control points in the Georeferencer window no longer overlay the raster in the Georeferencer window. However, they do appear correctly on the map canvas (the main QGIS screen). In the Georeferencer window, they have in fact displayed, but half a world away to the south. That is, if the raster covers a rectangle with coordinates 300,000, 5834300 ; 362100, 5782700, the control points occupy an area bounded by coordinates 0,0 ; 6800, -5900. These small coordinates seem to correspond to the number of pixels in the raster image. So, it is no longer practically possible to edit the GCPs.

How do I solve the problem?

See screenshots below.

Image 1: Georeferencer window, and map canvas. After reopening Georeferencer, GCPs do not show in window, but show on canvas (the small red dots).

Image 2: Zooming out in Georeferencer window shows the GCPs are there but far away.

Image1 image2

2
  • Hi, Ians, I have the same problem. Would you please let me know if you solved it? If yes, how?
    – Summer
    Commented Mar 11, 2020 at 3:46
  • Hi Summer. See my answer to my own question below, mainly paying attention to my point nr.1 there (the 3rd paragraph). That is how I solved my problem.
    – IanS
    Commented Mar 27, 2020 at 10:33

2 Answers 2

2

The GCP points do the matching between the source coordinates of the image and the destination coordinates of the CRS. In the first run, your image has only pixel coordinates, and the table is correct.

Once you have georeferenced the image, the georeferencer takes the georeferenced coordinates as source CRS, that's why the points do not match anymore.

Another irritating thing about the georeferencer is that it takes the srcY coordinates all as negative values, while GDAL (which works in the background) needs them inverted to positive values. These inverted values are added to your image, and will not match to the ones you see on the screen. You could try removing the minus from srcY to see if that makes it better.

You don't mention whether you saved the georeferenced image to another filename. That would keep the original file clean. Otherwise you would have to make a copy of the original before georeferencing.

1
  • Thanks Andre. So, the workaround might be to roughly georeference the image, save the points, close down, re-open, delete the original 'pixel size' GCPs, then do the proper georeferencing with the image now at 'CRS size'. I will try that and see, when I am back at my workstation.
    – IanS
    Commented Nov 30, 2014 at 10:04
1

The problem only occurs if you re-open the modified image that Georeferencer saved as a geotiff, rather than opening the original (unmodified, not georeferenced) image file used initially.

There are two approaches to solve the problem. In essence, you can choose when starting a new session of Georeferencer to either work on 1) the original image (e.g. rastermap.jpg) or 2) the geotiff that Georeferencer created during your initial session (e.g. rastermap_modified.tif).

1) If you re-open the original unmodified image, all the GCPs will reappear on the image, and there is no problem. You may have to manually reopen the GCPs. This is the method that Georeferencer was intended for.

2) If you open the geotiff that Georeferencer created, all the GCPs will be projected away off image. There is a solution (see below), but it requires effort. Georeferencer was not designed to be used in this way.

The initial question was premised on reopening Georeferencer using the geotiff, not the original image. Had the original image been reopened the problem would not have arisen.

However, there may be times when it is preferable to work with the geotiff. In this case, it is possible to make Georeferencer work properly with the following workaround.

The following steps for approach 2) are only added for sake of completeness. It is preferable to use approach 1) as explained above.

If you still opt for the more complicated approach 2) below, then the aim is to have a set of GCPs (ground control points) that remain located on the georeferenced image, even after Georeferencer is closed and reopened. The purpose of this is to have a set of GCPs that can be archived and edited in later sessions.

1) Roughly georeference the image with a minimal number of GCPs (four points is enough).

2) Save this newly georeferenced image with a new filename.

3) Save the GCPs.

4) Close Georeferencer.

5) Reopen Georeferencer, and open the geotiff that Georeferencer had saved. We find that the image has been resized to match the CRS (the projection) of the main map canvas. The initial ‘pixel coordinate’ GCPs are now located off-image.

6) Delete the initial GCPs.

7) Position a new set of GCPs on the image. These will now match the CRS of the main map canvas.

8) Save the new GCPs.

9) Re-run Georeferencer using a new filename for the geotiff.

You can now open and close Georeferencer using only the georeferenced geotiff, and still edit and re-edit the GCPs at will. However, you will not be able to reopen the original image file and resume working on it with the new points.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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