# Tackling Imperial and US Customary Measurements in Databases

### Share to social media

The old measurements of length, area, volume and weight in the UK and the States refuse to die. They are known as the Imperial and US customary measurement systems respectively. Not only are they a natural way of dealing with approximate measurements, and tied to human dimensions, but they are no longer difficult to calculate. The metric system has, of course, the advantage of being easy to calculate in your head, but even your phone has the computing power to deal with adding the old dimensions. The addition or subtraction of areas, volumes or distances isn’t such a problem any more, just as we no longer find that talking with far-away people is impossible. Technology makes the metric system less compelling.

This thought came to me when I was asked by a friend to calculate the relative area of woodland in the 1840s. The data was from a transcription of the Tithe records. In those days, fields and woodland was measured in Acres, Roods and perches. In fact, it isn’t just the old records and documents that have the old measurements but even today the old measurements are still used. (a hectare is roughly 2.47 acres). I never thought that this would happen to me, but here I was staring at a database containing an enormous number of fields, including their size, farm, occupier, owner, type and so on. The size was in Acres, roods and perches. It had to be aggregated. We needed to know the relative areas of pasture, meadow and woodland for each farm. We wanted to know the size of the farms and holdings and the variance in the amount of woodland. The way that the area of each field was expressed had to be turned into a decimal number so it could be used in calculations and aggregations. The result had to be expressed in the old way.

Here are some of the field sizes, along with the acreage expressed as a decimal, which is a useful ‘lingua franca’.

To achieve this, I created a simple function. It could have been simpler but the field areas were originally recorded by hand, which introduced a certain degree of irregularity; so it had to cope.

Some transcriptions use ‘ac.’ Instead of acres, ‘ro.’ Instead of roods and so on. The function is easily altered to cope with this. You also have the problem of malformed records. These will usually be zero, so if you filter out records with a reported zero acrage, you can correct the entry.

Now having done this, it is nice to go from acres as a decimal number to acres, roods and perches. This is, of course, trivial until you get to the details. This is basically the way that lists are done in English, where the list is comma-delimited until you get to the final pair, at which point you signal the end of the list by using the word ‘and’ between the final two elements.

Eg: Dopey, Doc, Bashful, Happy, Grumpy, Sleepy and Sneezy: 1 yard, 1 foot and 2 inches.

Why would we want to do this? Simple: firstly, we can use this for the aggregated results. Secondly, we can run a lot of tests and make sure that it is possible to cycle a whole lot of random areas expressed as decimal area values to and fro between the two functions until you hit an error where the original value isn’t the same as the generated value. I did this with thousands of records of acreage as recorded from the old tithe records, checking also that a result of zero was legitimate.

These two functions solved my problem and allowed me to do the calculations easily.

It occurred to me, of course, that this same sort of function could deal with other type of measurement. Here we can calculate distances

Once more, we can translate back from a decimal to a string. Naturally, it does all the conversions for you so that you can use the functions for calculating your timber cutting-lists. Well, certainly in the UK, the conformance to the metric system is skin-deep at best; the real work is done in old measurements.

You can test this out….

….or …

The old measurements of weight, area, distance and volume were never legislated out of existence in favour of the metric system of revolutionary France. They merely went underground. The technology can nowadays cope with any awkwardness. I was able to come up with reports based on the meticulous measurements of our forebears, and these were measurements that they could and did perform in their heads. It was very satisfactory, though, to be able to get these figures. I therefore relax in my acres of garden, raising a pint as toast to a stubborn breed of people who don’t give an inch in the face of the bureaucratic rush to the metric system.

### Phil Factor

See Profile

Phil Factor (real name withheld to protect the guilty), aka Database Mole, has 40 years of experience with database-intensive applications. Despite having once been shouted at by a furious Bill Gates at an exhibition in the early 1980s, he has remained resolutely anonymous throughout his career. See also :

342

2