2.4. Georeferencing an Image with Georeferencing Tool/Extension

Making Plugin available

QGIS allows users to expand functionality of the application through additional modules or plug-ins. We need to add the Georeferencer plug-in to QGIS first. Click on Plugins > Plugin Manager on the main menu bar (Figure 2).

Figure 2: Invoke Plugin Manager

The window with a list of available plugins will appear. Be sure that you check the Georeferencer plugin (Figure Ref).

Figure 3: Plugins Manager window

The Georeferencer plugin is now available on the system. In some versions of QGIS its button will appear on the menu bar, in other versions you should click on Plugins > Georeferencer > Georeferencer (Figure Ref).

Figure 4: QGIS menu bar with a new button

Now we can start using the georeferencing functionality of QGIS.

Georeferencing procedure

This section describes the major steps to georeference the image (Note: you do not need to add the image (raster) to the QGIS project).

  1. Start the Georeferer plugin, it will open the plugin window.

  2. Specify the image you would like to georeference by clicking on the [...] button and selecting the file. (This is amherstopo.tif in our case.

    Figure 5: Georeferencer Plugin File Selection

    Then press the [Enter world coordinates] button.

  3. The main plugin window will appear with the image in the center.

    Figure 6: Main Georeferencer Plugin Window

  4. Before preceeding further, please take a moment to learn the navigation/control tools of the plugin: zoom-in, zoom-out, zoom to full extent, pan, add control point and delete control point.

    Figure 7: Plugin navigation and control tools

  5. To add a control point, please zoom to a point you defined earlier (use zoom and pan tools). Then click on the [add control point] tool, position the cursor over the selected point and left click. A dialog window will appear.

    Figure 8: Adding Control Points

    Enter the X/Y coordinates and press [Ok].

  6. You will see a point depicted by QGIS and a yellow text box with coordinates.

    Figure 9: Results of registering point

  7. If you make a mistake entering a point, use the [delete point] tool to remove the point

  8. Repeat steps 5-7 for the other three control points. Be sure that you enter the correct coordinates for each point (See Appendix A for a closer look).

  9. Then click the [Generate worldfile] button and close the Georeferencer window.

This sub-step is required only for users of QGIS0.8.x for Windows. Apparently, the new version of the Georeferencing plug-in (currently 0.8.x) has a bug, which causes incorrect calculations for one parameter in tif-world file. This bug was reported to the QGIS team and is expected to be fixed.

Meanwhile, we've devised a workaround for this issue (Sorry--this is a bit complicated and ideally is something you shouldn't have to do if the software is working correctly. Rem?mber QGIS is very new -- we're using a release that is not even version 1.0 yet! -- and the developers are still programming some of the fundamental components. This type of thing is a tradeoff of using newly developed open source software rather than using proprietary software that has been around.)

To "fix" the world file for your "newly" georeferenced tif image you need to:

  1. open the tif world file for your image (it has the same name as the tif image and a *.tfw extension).

    1. you can use any text editor (such as Windows Notepad or Wordpad found under Programs, Accessories) to edit the twf file (Figure 10a)

  2. the georefencing plugin creates a "world file" for the image. This file consists of 6 records: the first four records store information on pixel distortion(s). In other words, how much each pixel should be "stretched/shrinked" to cover correct area. As you see there is nothing really mysterious about the "world" file.

http://linuxlab.sbs.umass.edu/intro-fossgis-umass/index.php?title=Image:GeorefFixWorldFile.png Figure 10a: Correcting the tif world file

Apparently, due to this bug in the software, the plugin computes the X coordinate (number in 5th row) incorrectly. To fix it for the image we are using, please change the number in the fifth row to 701958. Then save the file.