šŸ“ŒQGISIntermediateā±ļø 4 mins read

Georeferencing Scanned Maps in QGIS

Published by GISTECHNEWS Editorial Team • Peer-Reviewed & Verified on QGIS 3.34+ LTR & Python 3.10+

A vast amount of valuable geographic information resides in non-digital paper formats: historical cadastral village maps, old topographic sheets, printed engineering site blueprints, and drone ortho-mosaics without spatial headers. Georeferencing is the process of assigning true real-world geographic coordinates to an unreferenced raster image. By identifying recognizable ground features on both the scanned image and a reference basemap, you establish a mathematical transformation matrix that translates, rotates, and warps the raster onto the Earth's surface with sub-pixel spatial accuracy.

šŸ“‹ Prerequisites

  • QGIS 3.34+ installed.
  • An unreferenced scanned map (JPEG, PNG, or TIFF).
  • Access to OpenStreetMap or Google Satellite basemaps in QGIS.

šŸ› ļø Technical Environment

Required Software: QGIS Georeferencer (Recommended: QGIS 3.34+ LTR)

Practice Dataset: Historic Municipal Cadastral Map Scan

Source Portal: Public Cadastral Survey Archives

CRS / Format: Target: UTM EPSG:32643 (JPEG / TIFF)

šŸ“Š Conceptual Technical Diagram: Ground Control Point (GCP) Transformation Matrix

Mathematical transformation mapping raw raster pixel coordinates (X, Y) to real-world geodetic coordinates (Easting, Northing).

Raw Scanned Cadastral Map Coordinate System: Pixel [X, Y] GCP 1 (450, 680) GCP 2 GCP 3 GCP 4 Unprojected Bitmap (JPEG/TIFF) Affine / Polynomial 1 Transformation Matrix Residual Error: < 1.0 px Georeferenced GeoTIFF CRS: WGS 84 / UTM Zone 43N X' = aX + bY + c Y' = dX + eY + f Perfect Spatial Alignment

Step-by-Step Workflow & Methodological Execution

1

Module 1: Launching the Georeferencer & Selecting Ground Control Points

In QGIS 3.34+, the Georeferencer is built natively into the core application: 1. Navigate to Raster -> Georeferencer to launch the standalone rectification window. 2. Click 'Open Raster' (top-left) and select your scanned map image. 3. Identify Ground Control Points (GCPs): A GCP is a distinct, permanent feature clearly visible on both your historical scan and modern satellite imagery. Ideal GCP locations include: • Road or railway intersections • Corner posts of historic masonry bridges • Distinct geological rock outcrops or canal junctions Avoid ephemeral features like river banks or agricultural field edges that shift over decades. 4. Click 'Add Point', click on the feature in the scanned image, and select 'From Map Canvas'. Then click the identical geographic feature on your main QGIS basemap.

2

Module 2: Choosing the Right Transformation Algorithm

Click 'Transformation Settings' (the yellow gear icon) in the Georeferencer. You must select an algorithm appropriate for your map's distortion characteristics: • Linear / Helmert: Performs only uniform scaling, translation, and rotation without warping. Requires minimum 2 GCPs. Suitable for modern CAD blueprints. • Polynomial 1 (Affine): Allows non-uniform scaling (stretching in X different from Y) and skew. Requires minimum 3 GCPs. Ideal for high-quality flatbed scans. • Polynomial 2 & 3: Accommodates complex paper shrinkage, scanner lens distortion, and optical barrel warping. Requires 6 to 10 GCPs. • Thin Plate Spline (TPS): A local rubber-sheeting algorithm that forces every GCP to match its reference coordinate with zero residual error. Excellent for severely warped historical hand-drawn village maps.

3

Module 3: Evaluating Residuals & Root Mean Square Error (RMSE)

The bottom of the Georeferencer displays the GCP Table, reporting Residual Error ($dX$, $dY$, and Total Residual in pixels) for every control point: • High Residuals: If a point shows a residual error significantly higher than others (e.g., 35 pixels while others are under 2 pixels), you misidentified the feature. Disable or reposition the faulty GCP. • Target Root Mean Square Error (RMSE): For professional cadastral work, strive for a Mean RMSE below 1.5 to 2.0 pixels. • Output Generation: Set Resampling Method to 'Cubic' or 'Lanczos' to prevent pixel pixelation. Check 'Generate PDF map' to preserve audit logs, and click 'Start Georeferencing' (green play button). Your rectified map will immediately drape over the modern basemap in the QGIS canvas.

āš ļø Common Errors & Troubleshooting

āŒ High Mean Residual Error (>5 pixels)

šŸ’” Resolution: Inspect the GCP table; look for individual points with large error vectors and delete or re-align them.

āŒ Warped output image appears severely twisted or mirrored

šŸ’” Resolution: Ensure you have not inverted X and Y (Easting and Northing) coordinates during point entry.

šŸ’” Expert Tips & Best Practices

  • Distribute Ground Control Points evenly across the periphery and center of the map; avoid clustering points in one quadrant.
  • Use Polynomial 1 (Affine) for flat, scanned aerial maps, or Thin Plate Spline (TPS) for warped historical paper maps.

šŸ Python GDAL Programmatic Georeferencing Script

from osgeo import gdal, osr

# Open the raw unreferenced image
src_ds = gdal.Open("historical_scan.jpg", gdal.GA_ReadOnly)

# Define Ground Control Points (GCPs): (X_pixel, Y_pixel, Lon, Lat)
gcp_list = [
    gdal.GCP(77.1025, 28.5532, 0, 150, 200),
    gdal.GCP(77.2140, 28.5510, 0, 1850, 210),
    gdal.GCP(77.2115, 28.4520, 0, 1820, 2450),
    gdal.GCP(77.1001, 28.4550, 0, 140, 2420)
]

# Set projection for GCPs (WGS 84)
srs = osr.SpatialReference()
srs.ImportFromEPSG(4326)

# Apply GCPs to memory dataset and warp using Thin Plate Spline
warped_ds = gdal.Warp(
    "georeferenced_output.tif",
    src_ds,
    tps=True, # Thin Plate Spline algorithm
    dstSRS="EPSG:3857", # Output Web Mercator
    resampleAlg=gdal.GRA_Cubic
)
print("Georeferencing warp completed successfully.")

šŸ”— Related Tutorials & Practical Workflows