Georeferencing in QGIS

Georeferencing is the process of assigning coordinate information to a raster based on reference data with known coordinates. This tutorial walks through the process of georeferencing within QGIS by aligning a map to projected vector data. 

Included in this tutorial:

  • Setting up QGIS for Georeferencing

  • Georeferencing: Accessing the Georeferencer and Adding Your Raster Dataset; Adding control points to your raster; Checking Accuracy and Adjusting Control Points

  • Transformation & Outputs: Transformation Settings; Running the Georeferencing operation

  • More Notes & Tips on Control Points

Software version in examples: QGIS 3.40.5-Bratislava

Tutorial Data: This tutorial utilizes a polygon vector dataset of 2020 census tracts in Queens County, NY and a PDF map of these census tracts.

Credits: D. Wexler & L. Meisterlin (2025)

 

Setting up QGIS for Georeferencing

Georeferencing raster data (such as a scanned map saved as a PDF, JPG, or TIFF) requires accurate location data to which the map can be aligned. For this tutorial, we will demonstrate with a PDF image of 2020 census tracts in Queens County, NY. As a result, we will use vector data representing the same census tracts as our reference data to make the georeferencing process as straightforward as possible. Discrepancies between your raster image and reference vector data can make this process more difficult. 

Georeferencing assigns geographic coordinates to a layer. Thus, we must start by confirming the CRS of our map canvas and our reference layer(s).

  1. Check your map canvas CRS (found in the bottom right corner of your QGIS window). Confirm that it is the CRS you want to apply to the raster layer. If necessary, change the map’s CRS.

  2. Add your vector reference data layer(s) to the project and confirm its CRS. If necessary, reproject your vector data to match the map canvas CRS.

Because we are adding spatial reference information to a PDF which lacks this location information, it is important to be thoughtful about the projected coordinate system being used before you begin georeferencing. Wherever possible, using a local CRS will help increase the accuracy of our results. 

With our tutorial’s demonstration data, we set the map’s CRS to EPSG: 2263 (NAD 83/New York Long Island (ftUS)).  After adding our vector reference data, we will get a warning that a “ballpark transform” was used to transform coordinates from EPSG:4326 - WGS84 to EPSG: 2263 (NAD 83/New York Long Island (ftUS)) on the fly. For projects where very high locational accuracy is necessary, you might consider reprojecting your layer if the difference in datums could affect your work. For the purposes of this tutorial, the ballpark transformation will be adequate.         

A note before getting started with georeferencing  

Georeferencing is not an exact science; rather, it is a technique that requires adjustment and tinkering. Consequently, there is no one “right” way to georeference but there are general approaches which will help improve the accuracy and quality of your georeferenced work. We will call attention to these approaches.


Georeferencing

Accessing the Georeferencer and Adding Your Raster Dataset

To get started, access the Georeferencer tools by clicking through Layer (from the main menu) > Georeferencer

accessing the Georeferencer

Next, you can add your raster layer by clicking on the checkered Open Raster button within the Georeferencer window. 

adding your raster dataset

Adding control points to your raster

Control points “connect” or relate specific locations within your raster layer to their corresponding locations within the reference layer (the vector data with known coordinates). We will walk through the process of adding control points below. First, here is the basic outline of the process:

  1. Access the Add GCP Point tool.

  2. Choose a control point location on the raster layer.

  3. Specify coordinates to assign to the control point.

Step 1. Access the Add GCP Point tool by clicking on its button within the Georefencer’s toolbar. The cursor, when hovering over the map image, is now a crosshair shape. 

locating the Add GCP Point button

Step 2. Choose a location on the raster layer that you can readily identify and “match” within the vector layer. When you have chosen your first location, click on the raster layer (at that location) as precisely as possible. (It is usually useful to zoom in.) Selecting distinct features, like the intersection of lines, may help improve the accuracy of your control points as they can enable greater precision and are easy to reference in the vector layer. When you have chosen a location on the raster layer, the Enter Map Coordinates dialogue box will automatically open.  

Step 3. The next step will specify the coordinates for this control point within the raster. In effect, we are telling the software to move the location of the raster control point to the coordinates of the map view, using the vector layer as a reference. (In other words, we want to connect the location of our raster’s control point to the corresponding location on our vector layer.) To do this, click From Map Canvas in the bottom-left corner of the Enter Map Coordinates dialogue box, and then click on the appropriate location using your vector layer (on your map canvas) as reference. 

NOTE: You can enable the snapping features (from Snapping Toolbar) to help improve your accuracy when clicking onto the vector data on your map canvas. 

placing your control points by selecting from the map canvas

A new control point is successfully placed when a red dot appears on your map canvas and the X and Y coordinates in the Enter Map Coordinates dialogue box are populated. 

Repeat. The first control point will give a single point of placement information to the raster. Adding more control points (minimum of three) will stretch and scale the image to match the coordinates of the map canvas. Repeat the process of adding control points until you have an adequate number and are satisfied with the results. See Notes on Control Points at the end of this tutorial for more tips.

Checking Accuracy and Adjusting Control Points

The control points we have added do not permanently change the raster image. These “connections” between the raster’s cells and the map canvas are saved only within this map project. This gives us the ability to make changes and adjustments before creating a new georeferenced raster dataset from our results. 

Residual Values

After adding control points (but before running the georeference operation), check the accuracy of the control points. Locational information for each control point is listed in the GCP Table at the bottom of the Georeferencer dialogue box. Each row represents a control point; the columns list coordinate information related to each control point (source, destination, and difference in locations). 

the GCP Table with residual information highlighted

The final column of the table, Residuals (pixels), indicates the error between an estimated and an actual location for a control point. In other words, these residuals are the distance between the control point’s location on the raster and the corresponding coordinates on the map view. The closer the number is to zero, the more accurate the location of the control point. With three control points or fewer, the residuals will be zero (because three points determine a plane). Starting with the fourth control point, locations will be stretched or pulled to minimize the residuals across all control points. You may notice residual values changing as you add control points. 

The Georeferencer also provides this information visually: if you zoom in very closely to a given control point, you will see a red line indicating the residual distance (and the direction of this “pulling”).

checking control point accuracy using visual cue

Editing Control Points

To remove a control point, click the Delete GCP Point button from the Georeferencer’s toolbar, and then click the control point you want to delete within the Georeferencer. 

locating the Delete GCP Point button

To adjust the location of your control point, click the Move GCP Point button from the same toolbar, and drag your control point to a new location within the Georeferencer.

locating the Move GCP Point button


Transformation & Outputs

When you are fully satisfied with your georeferencing, it is time to create a new raster dataset–complete with coordinate information in the chosen CRS–through transformation. To do this, we establish (or confirm) the Transformation Settings then Georeference using these settings.

Transformation Settings

Click the Transformation Settings button on the to open the dialogue box. We will walk through the different settings below.

locating the Transformation Settings button on the Georeferencer toolbar

Transformation Parameters

transformation parameters in transformation settings dialogue box

In the Transformation Settings dialogue box, choose your Transformation type and Target CRS. 

The transformation type determines how coordinates are assigned to the raster between the control points. (A description of different transformation types is forthcoming and will be linked here for your reference in the future!) The optimal transformation type will depend on your data and your project needs. For the purposes of this demonstration, a linear transformation is appropriate. 

Your Target CRS should match your map canvas (and your reference layer’s) CRS.

Output Settings 

output settings in the Transformation Settings dialogue box

Under the Output Settings, you will specify a name and a location for your output file.

The Resampling method determines how values will be assigned to the newly georeferenced raster’s cells, based on the input raster’s values. Consider that the new raster will not have the same cell geometry of the original, and thus its values will need to be recalculated, estimated, or “resampled.” Like the transformation type, the appropriate resampling method will depend on your raster data and your project objective. (A description of different resampling methods is forthcoming and will be linked here for your reference in the future.) Nearest Neighbor is most appropriate for discrete data, like our demonstration data. 

For the purposes of this tutorial, we leave the other options with their default settings. Briefly, a couple common options here deserve description.

The Use 0 for transparency when needed option applies to areas of the output raster that will be “filled in” where no input cells currently exist. This happens when georeferencing creates results that are not cardinally rectangular. Checking this box will give those new cells a value of 0; leaving the box unchecked will assign null values to these new cells.

The option to Set target resolution allows you to specify the cell size (resolution) of the output raster layer.

Reports & Other Outputs

final output options within the Transformation Settings dialogue box

You have two options to output reports in addition to the output file (specified above). The Georeferencer can output a quick map as well as a report of the georeferencing operation. To create either, specify their names and locations where they should be saved. 

You can save the control point information by checking the Save GCP points option. This can be helpful if you plan on revisiting the same raster file and vector data in the future for a different project. (More on saving and retrieving control points at the end of this tutorial.) 

Lastly, to add the outputted, georeferenced raster to the current project when it is created, make sure the Load in project when done option  is checked.

When you are satisfied with the Transformation Settings, you can click OK to save the settings and close the dialogue box.  

Running the Georeferencing Operation

The next (last) step is to output a georeferenced layer applying our transformation settings and control points! Click the Start Georeferencing button in the Georeferencer’s toolbar. 

raster dataset ready for georeferencing

Once the operation completes, your raster layer should appear on your map canvas (if the option was checked in the Transformation Settings). If well georeferenced, it will be spatially aligned with your reference vector layer. 

final output from Georeferencer


More Notes & Tips on Control Points

Where to place control points? While every project is different, there are some general rules of thumb. Disperse control points across your raster map, with a few control points placed near the corners (or edges of the map portion of the image) to set the overall scale and dimensions of the map and a few control points spread across the interior.

How many control points? “More control points” is not the same as “better control points.” The target number of control points needed to georeference your raster data will vary depending on the method of transformation you select within Transformation Settings. If you run the georeference operation and are dissatisfied with the accuracy of your result, you can make adjustments to your control points and transformation settings and rerun the operation until your output meets the quality standards of your project. We will often test several versions, reading the impact on our residual values with different control point locations.

Saving and retrieving control points for later:  It can be useful when working on multiple machines or project files, when collaborating, or for the purposes of project documentation to save your control point data. At any point in the process, you can save your control points with the Save GCP Points As… button in the Georeferencer’s toolbar. 

To retrieve a set of control points (from an earlier version or a different project) and apply them to a raster, you can access a saved set of points by clicking the Load GCP Points button. 

buttons to Load (left) and Save (right) GCP Points within the Georeferencer’s toolbar

 
Next
Next

Digitizing Polygons