Trig points, also known as Triangulation Pillars, are concrete pillars which can be found smattered all over the UK and were placed by Ordnance Survey. Atop each pillar is a metal plate to fix surveying instruments. Together, trig points form a mesh where the distances between each trig point can be measured using triangulation. This allows the location of just about anything to be accurately determined relative to the mesh - it lets us draw the map of the UK. Today trig points are rarely used by OS, favouring GPS instead. However, since many are marked on OS maps, they can still be used for navigation, or more often to signify the summit of a hill, where one can enthusiastically ‘bag’ the trig by slapping the top. In fact, there are people who make it their mission to slowly bag all 6000 trigs in the UK. This isn’t me (yet!) but I do go out of my way to bag them, so I spend a lot of time looking at maps and planning routes that include them. Which got me wondering about some trivia: which ‘pair’ of trigs in the UK are closest to each other? This blog attempts to answer this, and related trivia, programmatically. There is a mix of geography, mathematics, and computer science ahead, but if you’d rather skip the details you can do so here. If you want the really nitty gritty details, you can view the python notebook on github here.

Data & Preparation

First, we need a dataset. Thankfully this was provided by lonewalker.net. This CSV file provides the trigpoint name, the reference on TPUK, Trig Type, Condition, Height, and 10-figure grid reference. I prepared the data by filtering for trigs that are “visitable”, meaning their condition is not “Destroyed” or “Possibly missing”, and filtered for trigs that are the classic pillar type. I also noticed that there are around 450 entries with duplicated names. In most cases it seems that this is when a trig had become damaged and rebuilt by OS at a later date. Duplicate entries based on the names were removed. Finally, to make the data easier to work with for measuring distance, I converted the 10-figure grid references into decimal lat-long coordinates using a python library. This library supports different Earth Geoids for converting coordinates. Geoids are shapes, or reference frames, that essentially define what it means to be at some point on the Earth’s surface. It’s the surveying equivalent of zeroing your kitchen scales. Because the Earth is not an exact sphere (or even elipsoid!), there are a variety of different standards. OS have used OSGB36 for grid references in the trig point dataset, which is more accurate for use in the UK, but migrated in 2000 to WSG84 used globally by GPS applications.

Method

Consider a flat Earth…

Calculating the distance between two points in OSGB36, that is two points that lie on a 3D ellipsoid, is more complex than calculating the distance between points in 2D. In the case of the ellispoid, one such formula to achieve this is the Haversine Formula which involves several instances of trigonometric functions sin and cos. Benchmarks show that, in general, these functions are an order of magnitude more expensive to compute than basic math functions such as additions and subtraction.

The other reason I don’t want to use the Haversine Formula is that I can’t be bothered to implement it. I will show how, if we consider the Earth to be flat (!), the error compared to if we assumed it to be an ellipsoid is small.

The error between ellipsoid and cartesian will be larger when we measure over a larger distance, so lets consider the worst case where we want to measure between Lands End (50.06568, -5.71304) and John-O-groats (58.64399, -3.07003)

Results So what are the two closest trig points?