Measure sloping land

When is 2,500 square metres not 2,500 square metres?

Written up by Alasdair Rae, with calculations, input and inspiration from Ed Ferrari and Ruth Hamilton

The problem

Let’s say you have a raster dataset at a resolution of 50m x 50m.

You know that each cell covers 2,500 square metres.

But that’s only if the land is completely flat. In reality, it’s not likely to be completely flat and this means it’s not likely to be exactly 2,500 square metres either.

Land is measured as if the world is flat - otherwise it would be very complex - but let’s imagine you’re a mountain goat and want to know the true area you have to roam.

How do you find out the true area of land?

Actually, the goat thing isn’t the best example, but it works in areas where you can still actually graze and walk. On cliffs it’s every goat for themselves.


Let’s take an extract of mountainous terrain

We need some hilly land, so let’s go to the Cairngorm Mountains in the north of Scotland.

Here’s a link to the Google Street View someone has put online. It’s in a pass called the Lairig Ghru (‘larig groo’).

To the right, you can see the rough area this covers (NH90SE, if you must know).

It looks like this

Let’s look at this using the OS Terrain 50 product

Using the Ordnance Survey’s Terrain 50 product - free, open data - we can add a 50m x 50m resolution dataset and it looks like the image to the right. This is tile NH90 SE (extracted from NH90).

The next step is to use the raster tools in your GIS (I used ArcGIS and QGIS) to calculate the slope for each cell.

You can see this on the next slide - screenshotted from QGIS.

This is what it looks like when you generate the slope data. It ranges from not very steep to very steep indeed (over 72 degrees).

Now some trigonometry

All we need to do now is apply some high school level trigonometry to figure out the area of each cell, based on the degree of slope.

NOTE: when you do this in a GIS, you will need to convert the degree values in the slope layer BEFORE doing any further analysis, otherwise it will give you weird, incorrect results. See this page for more information. See the next few slides too.

What’s the correct formula for this? Well, why not check out this roofing calculator - it’s the same idea.

The basic calculation is raster cell area divided by the cosine of the slope (once you’ve divided it by 180/pi or approximately 57.2957795131)

The steps I used

  • Download raster containing elevation data (I used OS data for Great Britain but you could do this with any similar data, even like SRTM data for most of the world at 90m resolution).
  • Use the raster analysis tools in your GIS to calculate the slope degree value for each cell.
  • Divide the degree slope values by 180/pi (approx 57.2957795131), again using the raster calculator.
  • Calculate the area of each cell by dividing the area of the original raster cell by the cosine of the slope - in my case it was 2500/cos(slope) (because I had 50m resolution cells and the area of each cell is 2500 square metres.
  • Use Zonal Statistics or some other method to find out the new total area.

What next?

You should now have a raster layer that has the ‘true’ area of each cell in it. It’s still going to be approximate, but it will give you a better idea than the original ‘flat earth’ raster.

You’ll know if it has worked

The minimum value for a cell should just be the square of the cell resolution - in our case 2,500. The maximum may be double that, or more, depending upon the slope. Be careful in QGIS as the true max may not display in the layers panel.

You can see the area values for our 50m calculation to the right.

Eyeball it to make sure it looks right

As you can see from the example to the right, the values for the 50m raster go from a low of 2500 (that’s 2500 square metres) to over 4300.

Look closely to the right and you’ll see that I’ve also done this using a 5m resolution raster - more on that soon.

Use ‘Zonal Statistics’ to calculate the new area

You can do this in ArcGIS and QGIS quite easily.

You need some kind of polygon layer and in this case I used a square bounding box that fits neatly round the outside of the raster.

The results are on the next page for both the 50m resolution raster and a 5m raster from Ordnance Survey (the Terrain 5 DTM product, via Digimap).

50m DTM vs 5m DTM

Some stats comparing the two datasets

So where did we get to?

In the 50m resolution dataset we had an area apparently covering 25,000,000 square metres to begin with. This is more easily understood as 25 square km.

The same was true of the 5m resolution DTM (digital terrain model, in case you’ve forgotten).

Two points to take away here

  • When you measure land in this way, it grows. The 50m DTM grew from 25 sq km to 26.8 sq km and the 5m DTM grew from 25 sq km to 27.0 sq km (7.1% and 8.0% respectively).
  • Scale of measurements matter. The finer the scale, the more land you can find. This is kind of related to fractals, on which you can read more here.

We also tried this for whole countries

Results for Switzerland are a little more significant.

Area: 41,289,760,000 m2
Ground area: 44,163,021,929 m2
Increase: 6.96 %

Even more so for Lichtenstein: 8.72%

Note: Ed Ferrari did these bits. It is based on a 200m resolution DTM.


But there are other things you need to consider: this is still an abstraction, an imperfect model; slopes are not as simple as our model suggests, they tilt on multiple planes, cliffs or other vertical areas have ‘zero’ or infinite area in this view; 50m is very coarse, and so on - you can think of more if you try hard


Think about this. These calculations only make sense in certain situations. For example, if you are a mountain goat, a hill sheep or similar. But there are other use-cases too.

This a link to these slides, in an easy-to-remember format - it’s just and then measure land area as one one word.

Measure sloping land - Google Slides