How to Georeference a map in QGIS

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:

Orfeo Toolbox – Satellite Remote Sensing for QGIS

OTB1

Orfeo Toolbox 4.0 (OTB) is now available for QGIS on Ubuntu 13.10 and 14.04 via the UbuntuGIS Unstable repository (it was previously available for earlier versions of Ubuntu and separately MS Windows via OSGeo4W). OTB, which can be accessed via the Processing Toolbox, provides QGIS with advanced satellite remote sensing capabilities, the sophistication of which maybe best appreciated upon thumbing OTB’s rather daunting 732 page manual.

OTB is a library of image processing algorithms based on the medical image processing library ITK v4, adapted for analysis of high resolution satellite imagery. Its algorithms are tuned to cope with huge images, that normally require supercomputer facilities, by using streaming and multithreaded processing.

The OTB project was initiated the French Space Agency (CNES) in 2006 with the objective to provide a suit of opensource tools for the analysis of images produced by the Orfeo constellation of satellites; Pléiades and Cosmo-Skymed. The motto of OTB is “Orfeo Toolbox is not a Black Box”, its algorithms are openly documented and its source code can edited by end users under the GNU compatible French CeCILL opensource license agreement.

The capabilities OTB have greatly increased since its initial release 8 years ago, especially with the release of version 4.0 in Feb 2014. It can now handle the optical sensors of SPOT, QuickBird, WorldView, Landsat and Ikonos, various multispectral sensors (e.g. Hyperion) and synthetic aperture radar imagery of TerraSarX, ERS and Palasar amongst others.

OTB’s sister application Monteverdi 2 can be installed as well. Monteverdi is a GUI batch processor for OTB that allows building complex processing chains by selecting algorithms from a set of simple drop down menus. As for future developments, the following is a demo of Orfeo Toolbox 4.0 controlled via Monteverdi 2.0, it uses the forthcoming OpenGL accelerated ICE API:

Reference:

Inglada, J. & Christophe, E. 2009. The Orfeo Toolbox Remote Sensing Image Processing Software. In: IGARSS (4). 733–736.

QGIS Podcast episode 7 now online

In the latest QGIS Podcast, Tim Sutton interviews Martin Dobias, a core developer of QGIS. Martin discusses recent developments in the QGIS project such as multithreaded rendering, python bindings and improved symbology. Multithreaded rendering, due out with QGIS 2.4, releases the full potential of modern multicore CPUs, resulting in improved responsiveness and a substantial speed-up in map rendering speed.

Podcast episode 7

Excellent QGIS tutorials courtesy of MangoMap

Image

MangoMap, a cloud platform where users can create and share web accessible maps, is running an excellent weekly video tutorial series on QGIS. Now in its third week, the introductory course has so far covered the QGIS interface, Creating a Basic Map and Custom Labelling. Each tutorial video comes with an exercise data download and videos can be downloaded and shared with those who don’t have internet access.

MangoMap QGIS Tutorials

Multithreaded Map Rendering in QGIS 2.4

The next release of QGIS will have multithreaded map rendering, a feature initially added to QGIS Enterprise in late 2013, a customised version of QGIS provided by the Swiss consultancy firm Sourcepole. The code providing multithreaded rendering is now part of the unstable development branch of QGIS, which is now undergoing testing. So what is multithreaded map rendering and does it mean for QGIS?

All modern desktop computers have multicore CPUs, with 4 to 8 processing cores on a single CPU die. In theory, multicore CPUs allow computer code to run in parallel on each processor core resulting in a considerable speed advantage. However, standard computer code does not take advantage of extra processing cores, so called single-threaded code uses one core at a time.

This is because multithreaded computer code has to be explicitly written and compiled in order to take full advantage of modern multicore CPUs. This is no easy task and multithreaded applications remain comparatively rare, generally limited to multimedia, games and computer graphics applications that require CPU intensive calculations.

Computer scientist Martin Dobias, who is adding multithreaded rendering to QGIS explained in a recent interview that the development version of QGIS was initially quite unstable, it often slowed down or even crashed because more than one processor core attempted to access the same data at the same time. In order for multithreaded rendering to work it was necessary to get the CPU cores to work cooperatively rather than competitively.

The current version of QGIS, 2.2 Valmiera, is single threaded. It uses one CPU core when redrawing the map window or when a menus are selected, it cannot multitask within its own application. This typically causes QGIS to become unresponsive while a map redraws when one zooms or pans. This is especially true for large data sets.

However, as seen in the demo video below, the development branch of QGIS 2.3 now has stable multithreaded map rendering. There is a considerable increase in map rendering speed but also significantly, the interface of QGIS remains fully responsive. Furthermore, the already impressive responsiveness will grow proportionate the number of CPUs and cores provided. Imagine QGIS 2.4 running on a modern dual CPU Xeon workstation, with up to 24 CPU cores and 48 processor threads. This is just a taste of what to expect in QGIS 2.4 which is due for release on the 20th of June.

http://vimeo.com/87762709

QGIS 2.3 Multithread rendering from Oslandia on Vimeo.

Note: This article was edited to include the recent interview of Martin Dobias by Tim Sutton.

Listen to the latest QGIS Podcasts

Tim Sutton of Linfiniti Consulting, a lead developer of QGIS, recently started The QGIS Podcast. Now in it’s 6th instalment, The QGIS Podcast gives an exciting insight into the current developments and future plans for QGIS and related open source GIS projects.

In the latest episode Tim interviews Paul Ramsey. Paul is a key developer of PostGIS, an enterprise grade geospatial extension for the free and open source PostgreSQL database management system. This extension allows the database to store, manipulate and query shapefile and raster spatial data.

Paul cited two interesting examples where PostgreSQL/PostGIS is used enterprise environments; the Institut Géographique National (the French national mapping agency) and the British Ordnance Survey. The British Ordnance Survey stores it’s master map of half a billion records in a PostgreSQL/PostGIS database. Subscribers can access the master map via the Ordnance Survey’s OnDemand web service.

The QGIS Podcast

Dublinked Data Visualisation Competition

Dublin’s geospatial data sharing portal, Dublinked, announced a data visualisation competition as part of the Dublinked Innovation Network’s second Data Visualisation event, that was held in NUI Maynooth in March 2014.

The challenge is quite simple, to create a data visualisation (static or interactive) using data from the Dublinked Datastore.

The closing date 12 Noon Wednesday 7th May 2014.

Dublinked Competition Details