geoprimsField-grade geospatial math

Site localization (calibration)

Fits local site coordinates to grid coordinates through control points seen in both, by a similarity (scale, rotation, shift) or affine transform, with residuals, their root mean square, and a check for a feet-and-meters mix-up.

A published result changed on 2026-10-13: Promoting site localization to stable removed the EXPERIMENTAL_TOOL warning, so NO_REDUNDANCY and SCALE_SUSPECT moved from warning index 1 to index 0. Changelog

0.999968514

The fit has a scale of 0.999968514, and its residuals average 0.0013 m (root mean square).

Residuals
PointNorthing residualEasting residualHorizontal residual
CP10.0007 m-0.0009 m0.0011 m
CP2-0.0005 m0.0008 m0.0010 m
CP30.0008 m-0.0012 m0.0014 m
CP4-0.0010 m0.0013 m0.0016 m
Scale offset
Rotation
Root-mean-square residual
Northing shift
Easting shift
a
Provenance
Computed by
survey.gnss.localization 1.1.0, core 0.1.0
Model
Least squares on centroid-reduced coordinates. Similarity: E = a·e + b·n + tE, N = c·e + d·n + tN with d = a and b = −c, scale √(a² + c²), rotation atan2(c, a). Affine: E = a·e + b·n + tE, N = c·e + d·n + tN, scale √|ad − bc|. Local and grid values are compared in meters
Accuracy
Exact least squares; the transform is only as good as the control points and holds within their extent
Notes
None
Cites
Ghilani, C. D., and Wolf, P. R., Pearson, Elementary Surveying: An Introduction to Geomatics; International Association of Oil & Gas Producers, IOGP Publication 373-7-2: Coordinate Conversions and Transformations

Something look off?

Your values

Showing an example. Change anything.
Run many at once from a CSV

Loading…

How we got thisFormula, worked example, sources, and proof

Model: Least squares on centroid-reduced coordinates. Similarity: E = a·e + b·n + tE, N = c·e + d·n + tN with d = a and b = −c, scale √(a² + c²), rotation atan2(c, a). Affine: E = a·e + b·n + tE, N = c·e + d·n + tN, scale √|ad − bc|. Local and grid values are compared in meters

Show your work

  1. Rotation

    atan2(c, a) from the least-squares coefficients

    a = 0.999625908, c = 0.02617389 = 1.499872°

  2. Scale

    (a2+c2)

    a = 0.999625908, c = 0.02617389 = 0.999968514

The same steps an agent gets from the MCP server with explain: true.

Accuracy: Exact least squares; the transform is only as good as the control points and holds within their extent

When to use this: Use this when a job runs on local site coordinates and you need to tie it to State Plane or another grid using control points you have in both. Enter each point's local and grid northing and easting, pick a similarity or affine fit, and add the combined factor you expect. It returns scale, rotation, shifts, residuals, and their RMS, and it flags a scale that looks like a feet and meters mix-up.

Limitations: The fit is horizontal only. It does not tie heights, a geoid, or a vertical shift. It holds inside the area the control covers and gets weaker outside it. The fewest points a fit needs give no check, so add more to see residuals that mean something. A large residual points to a bad control point, not to a fit that should be forced.

Worked example: Four control points, similarity. Source: Built at scale 0.99997 and 1.5° rotation with a few millimeters of noise; least squares after Ghilani and Wolf (2021).

You enter

Expected combined factor
0.99997
Control points
CP1, 5000 ft, 5000 ft, 1520129.021 ft, 3139867.253 ft CP2, 6000 ft, 5200 ft, 1521133.878 ft, 3140041.010 ft CP3, 5400 ft, 6100 ft, 1520557.663 ft, 3140956.371 ft CP4, 4700 ft, 5800 ft, 1519850.067 ft, 3140674.813 ft

You get

Scale
0.999968514
Scale offset
-31.5
Rotation
1.499872°
Root-mean-square residual
0.0013 m
Northing shift
461,772.006 m
Easting shift
955,547.9987 m
a
0.999625907781
b
-0.02617389049
c
0.02617389049
d
0.999625907781
Transform
similarity

Review: Not yet independently reviewed by a licensed surveyor.

Last verified: 2026-09-19, when a maintainer last confirmed this tool's sources at the issuer. See the sources ledger.

Status: version 1.1.0, core 0.1.0. See this tool in the verification report.

Changes

Checked against: 24 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.

Sources