Georeferencing Engine
How Routster mathematically aligns the real world to flat pixels.
Georeferencing is the process of mapping real-world coordinates (Latitude, Longitude) to the local pixel coordinates (x, y) of the uploaded map image. It is the most critical system in Routster; without it, GPS tracks cannot be drawn.
The Affine Transform Matrix
Routster uses a 6-parameter Affine Transform matrix to handle translation, scaling, and rotation. The matrix equations look like this:
x_pixel = A * lon + B * lat + C y_pixel = D * lon + E * lat + FMercator Projection
Ways to Georeference
There are three ways a map receives an Affine Transform in Routster:
1. Direct World File Parsing
If you upload an OCAD file accompanied by a World File (.pgw, .jgw, or .tfw), Routster's backend parses the 6 lines of text directly into the A, B, C, D, E, F parameters. This is the most accurate method.
2. OCAD Internal Georef
Modern .ocd files store georeferencing metadata internally. The Routster parser extracts the real-world offset and scale values stored in the binary file to automatically construct the matrix.
3. The Visual Georeference Editor
If the map is a raw image without metadata, you must use the Georeference Editor. This UI allows you to drop two (or more) pins on the image, and two corresponding pins on a real-world satellite map (like Google Maps or Mapbox).
Routster then solves a system of linear equations based on those coordinate pairs to dynamically calculate the 6 parameters of the Affine Transform matrix. The map image is instantly aligned, and your GPS tracks will snap into place.
