I was recently asked how to Georeference a map in QGIS, this a common and important task. Raster scans of paper maps and some satellite images are in pixel coordinates, they lack location information (no Longitude and Latitude values). In this case, QGIS will assume a single pixel is 1 metre square and it will place the Scanned map at 0o North, 0o West in the Atlantic Ocean south of Ghana. Not cool.
To prevent this we need to Georeference the map, change pixels coordinates into corresponding geographical values. This is done by clicking a visible landmark on the Scanned map and the exact same landmark on a corresponding georeferenced map, the GIS will attach geographical values to the Scanned map (see this interesting article about artificial landmarks used to Calibrate drones and satellites).
Georeferencing maps in QGIS is straightforward using the excellent OpenLayers Plugin. It allows you to add Google, Bing, OpenStreetMap and aerial photos to QGIS. We can take the geographical values from these maps and add them to our Scanned map. Here’s a step by step guide to achieve this:
1. Go to Plugins Menu – Manage and Install Plugins – Type OpenLayers Plugin – Install Plugin (you might have this plugin already).
2. Go to Plugins Menu again – Go to OpenLayers Plugin – Select “Add Google Physical Layer, Google Satellite Layer or Bing Aerial Layer etc.”… add whatever you like to the QGIS map canvas.
3. Move the map with the Hand tool, use the Magnifying Glass and/or the mouse wheel to Zoom to the same area as your Scanned map.
4. Go to Project Menu – Project Properties – Click CRS – Check the box “Enable ‘on the fly’ CRS transformation – type 3857 into the Filter box – Click WGS 84 / Pseudo Mercator – and hit OK.
5. Go to Raster – Georeferencer – Click “open raster” on the far left (left of the green triangle) – open your scanned map in the Georeferencer window.
6. The next stage is a bit tricky – you will need to find landmarks on your Scanned map that precisely coincide with locations on the Google / Bing / Street / Satellite Map in QGIS.
Tip – You might like to place QGIS and the Georeferencer Window side by side, so you can see e.g. the Scanned map next to a Google or Bing map. Good landmarks include bends in rivers, river confluence, road intersections, the corners of large buildings, rock outcrops, field boundaries and corners and small islands. Don’t click the tops of tall buildings, antennae or trees – locations are measured at ground / street level.
7. Zoom into your Scanned map in the Georeferencer window and the same are in the QGIS window – click a landmark in the Georeference window (using the yellow add point) – a dialogue pops up asking you to enter the coordinates – since you don’t know this value – you then choose click “from map canvas” – the Georeference Widow disappears – Now click the exact same landmark in the QGIS window using the cross hair – the map coordinates are added to the Scanned map the Georeferencer window.
Tip – it’s important to be as accurate as possible, so the final Georeferenced map will coincide with Google, Bing etc. These maps appear to be accurate to a few metres, I measuerd this using GPS. If you need better accuracy, you will need professional survey data and ground control points (bench marks).
8. Super Important – after adding all your Control Points – Save Them – if anything goes wrong you wont have to start from the beginning.
9. After adding about 8 to 12 points, which you are satisfied are in the same place on the Scanned map and the Google / Bing map in QGIS – hit the Green Triangle – the Transformation Settings dialogue will appear
10. Select Transformation Type – the selections available at the top of the drop down menu are e.g. Linear, Helmert – While faster they may give less accurate results – I usually choose Polynomial 2, 3 or thin plate spline – For Sampling – Choose Lanczos (smoother better results) – Choose the path of output Raster (where to save the georeferenced map) – The georeferenced map will be saved as a GeoTiff
11 – You must use the same CRS as the map canvas (see step 4). Check Target CRS – type 3857 – add WGS 84 / Pseudo Mercator (if you later need to change the CRS of a Raster it is necessary to use the Raster – Reprojection – Warp command).
12. Click the box “Load in QGIS when done” – then Finally click OK!!!
13. Your computer may take a few minutes – it will generate and save a Georeferenced Geotiff and add it to the Map Canvas.
14. If all goes well, the nice Georeferenced Map will appear in the QGIS Window and it will be perfectly aligned above the Google / Bing map OpenStreetMap below.
15. If there are any errors – the map will usually look seriously distorted – common errors involve mixing up a control point.
16. Don’t worry, mixing up a control point is a common mistake – if one of your control points is wrong – find that point and delete it – go to step 7 and repeat for that point (hopefully it’s just one point).
Congratulations that’s it!
Here’s a video demonstrating Georeferencing in QGIS: