Fun with georeferencing

Barbara Štimac Tumara
August 16, 2023

Let’s imagine a scenario: you are a geospatial analyst with really interesting Ottawa aerial photos [1] with some incredibly useful information about urbanisation you can't get anywhere else… or you are a curious enthusiast that has found a really cool old map in a antique bookshop… or you’re a tree-hugging mining engineer that wants to compare the difference in landscape before (really old map) [2] and after (todays satellite image) at one of the biggest open pit mines in the world, the Bingham Canyon Mine [3] (that one’s me). Thank you, good guy USGS for these maps I can use. Just look at this difference in altitudinal isolines, can you imagine how much that landscape has changed? A quick Google search can tell you a lot, but let's say I am interested in more objective and data-driven numbers.

Before (1896) and after (2023) in the Bingham Canyon Mine. Credits: NGMDB (2023), Google Earth (2023)

There are many things you may need to do, but one big leap starts with a small georeferencing step. So welcome to the wondrous world of georeferencing, a coordinate transformation that relates or binds a raster image to a specific spatial reference system of your choice, so it can be used for further analysis and visualisation. This gives you the control of knowing exactly where you are located, and ensuring no or minimal distortion in your data, or at least the knowledge of what distortions are happening. 

What you need to start is your ungeoreferenced file and, at least, the knowledge which spatial reference system you want for your final product. With that decided, you need a file georeferenced in the coordinate reference system to georeference your ungeoreferenced file. I know it sounds like georeferenception, but what it means in simple terms is that you need a basemap with the known coordinates to tell QGIS [4] that this specific point on your unknown map corresponds to that specific point in your basemap. One of the simplest solutions for choosing your basemap, in QGIS, is QuickWebServices [5] that gives you a final georeferenced product in WGS84 (EPSG 4326) [6].

First thing first, find and open Georeferencer [7] in your QGIS. Earlier versions of QGIS had it as a plugin, and newer versions have it automatically built-in. Keep in mind that versions before QGIS 3.26 had it under Raster Menu, and versions after QGIS 3.26 have it under Layer Menu. The explanation behind this shift is that now it incorporates the ability to georeference vectors, so it shouldn’t be under Raster Menu anymore, but my humble opinion is they like to make our life interesting with Search & Rescue type of games.

Georeference in the Layer Menu after QGIS 3.26. Credits: QGIS 3.26 (2023).

Inside the Georeferencer, where all the georeferencing magic happens, you can immediately spot some basic, universally-used commands like Add, Zoom, Pan, Load and Save. One thing to note is that this blog deals with raster images (like aerial photos, maps in pdf or jpeg format), but there is also a possibility to georeference vectors, if that’s what your heart desires. 

Georeferencer options. Credits: QGIS 3.26 (2023).

What is not immediately easy to spot is the Transformation settings, where you can provide some really interesting and specific parameters for your georeferencing. Without going into abysmal depths of math and university-long explanations of math behind the curtain, what you should know is what each option means. 

Transformation type just means the level of complexity you want for your transformation, meaning in how many ways and to which level of complexity can your original data be stretched, shrunk, shifted or rotated to fit the target coordinate reference system. If you have a dark desire to get lost in explanation, more information is available in the following link [8], but what you should at least keep in mind that 1st order Polynomial is used in most cases, and Linear actually gives you a Word file, and does not actually transform the raster pixel themselves, so be careful with that one.

Polynomial transformations. Credits: ESRI (2023).

Resampling method is a nonparametric method of statistical inference, meaning, in unnecessary complicated terms, deriving pixel values for a new image from an existing image. There are several resampling methods that you can use, and everybody and their cat have an opinion on what you should use and what gives best results, and I am here to tell you that in 85% of cases you can not go wrong with Nearest Neighbour or Cubic Spline. Again, there is a really nice post [9] that goes into a lot of details about this and please feel free to jump into that black hole of information. What is always a good idea, especially for that other 15% of cases, is to play with different resampling methods, try them out and see which one gives the best results per case basis. 

Transformation type and resampling method options. Credits: QGIS 3.26 (2023).

After that, rest of the parameters are simple: target coordinate reference system, output settings (where to put your new raster, how to name it and should it be compressed), as well as some other nice bonus features like saving the GCP (we’ll get there), using 0 for as no value, manually setting the resolution of the new raster, generating PDF map or a report. What you should end up with, is something similar to this, depending of course which transformation type and resampling method you decided to go with. 

Transformation settings final setup. Credits: QGIS 3.26 (2023).

With all that explanation in the beginning, it is finally time to add the old map/photo you want to georeference. And that magic of georeferencing happens with selecting Ground Control Points (GCP). What they are, or do, in the simplest terms is connect the same points in space between your basemap in a known coordinate reference system and your mystery map. Adding them is one of the simplest yet most complicated tasks in this whole story. What it looks like is a lot of back and forth between your unreferenced map/image and a basemap and trying to see if this matches that.

There are two main possibilities when adding GCP: either the old map you want to georeference has written the metadata on the side, like the projection and graticule or you just have no idea. If it's the first option, lucky lucky you, you can just write them in… or can you? Now you get to have fun with conversions (try here) [10]. 

In case you have no clue what the original projection is, there is still hope and you can easily manually match the point from your old map to the basemap you are using as your reference. 

Finding points that match. Credits: QGIS 3.26 (2023).

The completed list of Ground Control Points is then used in the transformation algorithm behind the scene to twist, rotate, shrink and adjust your mystery map to the coordinate reference system of your choice. Meaning, the more precise you are in this step, the better results you will get in the end. There is no magic number of Ground Control Points you should use, but a general rule of thumb is between 4 and 10. 

If your region of interest is in an urban area, count your geospatial blessing and use bottom edges of the buildings, road intersections, any man made easily distinguishable features. If you are not in urban area, it’s time to get creative and find tips of peninsulas or islands, really interesting bend in a river or a lake… word to the wise, try to use landmarks you are 99% sure didn't change their position, especially if using old maps, photos or working in an area that underwent drastic change in landscape features. Another problem is that you may not know the resolution of your old map and it may not be all that very detailed, but try to find the most distinguishable features of the landscape. 

The end result should be a table with a list of points in the source and target coordinate system along with some residual and error values. One thing, don't get scared of the red lines, these are georeferencing errors which show the residual difference between various sets of map control points. They, along with the Mean Error in the bottom right, give you an indication how good of a job you managed to do. If your mean error is high, you can always change, relocate or erase the Ground Control Point. 

When you are finally satisfied with your table, all there is left to do is to run the georeferencing tool, save your GCP Table and you’re done: you have your newly georeferenced tiff file.

Built GCP Table. Credits: QGIS 3.26 (2023).

And now you are keen to continue your analysis and visualise your new map to compare how well it fits over a basemap. With a few simple steps and some AI magic, publishing can be done through OCLI, and visualisation and inspection can be done through online platforms, like GOLDENAI Graphical User Interface. This interactive online data repository has many options, such as native language assistant, exploring many data layers at the same time, setting layer parameters and lens tool. If you are interested in OCLI and GUI, keep a look out for new blog posts, check out published data on GoldenAI GUI [11] or learn more with this Youtube tutorial [12].   

Final georeferenced map in GOLDENAI GUI platform. Credits: OPT/NET B.V. (2023)

Congratulations, you made it to the end and now you get to either do it all over again, if you have more maps and photos to georeference, or you continue with your new georeferenced raster in new and exciting analysis. For example, maybe you want to know the difference between then and now, old and new in a more precise way than just saying “yeah, that changed a lot”. That can of course be done with the magic of geospatial analysis, and that’s where I’ll see you in the next blog. 

Credits: Pixabay (2023).


[1] MacOdrum Library (2023, August 7). Carleton Campus - Aerial Images [Online]. Retrieved from: 

[2] USGS (2023, August 7). TopoView [Online]. Retrieved from: 

[3] Wikipedia (2023, August 7). Bingham Canyon Mine. Wikipedia. Retrieved from: 

[4] QGIS Development Team (2023a). QGIS Geographic Information System. Open Source Geospatial Foundation. URL: 

[5] GISGeography (2022, August 17). QuickMapServices: Basemaps for QGIS. Retrieved from: 

[6] Geomatic Solutions (2023, August 7). About the EPSG Dataset. GeoRepository. Retrieved from: 

[7] QGIS User Manual v: 3.28 (2023). 17.3. Georeferencer. QGIS User Guide 17. Working with Raster Data. Retrieved from:  

[8] Esri (2023), Equation-based methods. ArcMap. Retrieved from: 

[9] Stack Exchange Inc (2023). What is Lanczos resampling useful for in a spatial context?. Geographic Information Systems. Retrieved from: 

[10] NOAA (2023). NGS Coordinate Conversion and Transformation Tool (NCAT). Retrieved from: 

[11] Golden AI GUI (2023). Golden AI graphical user interface (GUI). GoldenEye project. URL: 

[12] OPT/NET B.V. (2023). OCLI - OptOSS Command Line Interpreter (GEO). Youtube video. URL: