LogoLogo
OS Docs HomeOS NGDOS APIsOS Download ProductsMore than MapsContact Us
  • More than Maps
  • Geographic Data Visualisation
    • Guide to cartography
      • Introduction to cartography
      • Types of maps
      • Symbology
      • Colour
      • Text on maps
      • Generalisation
      • Coordinate reference systems
      • Projections
      • Scale
      • Map legends
      • Map layout
      • Relief representation
      • North arrows
    • Guide to data visualisation
      • Introduction to data visualisation
      • GeoDataViz design principles
      • Types of visualisation
      • Thematic mapping techniques
      • Data visualisation critique
      • Accessible data visualisation
      • Ethical data visualisation
      • Software
      • Data
    • GeoDataViz assets
      • GeoDataViz basemaps
      • Stylesheets
      • GeoDataViz virtual gallery
      • Equal area cartograms
      • How did I make that?
        • Apollo 11 Landing
        • North York Moors National Park, 70 years
        • Snowdonia National Park, 70 years
        • Great Britain's National Parks
        • Great Britain's Islands
        • Great Britain's AONB's and National Scenic Areas
        • Famous shipwrecks of Pembrokeshire
        • Trig pillars today
        • Britain's most complex motorway junctions
      • #30DayMapChallenge
  • Data in Action
    • Examples
  • Demonstrators
    • 🆕Product Viewer
    • Addressing & location demonstrators
      • Address Portfolio overview
      • Which address product should you use?
      • AddressBase
      • AddressBase Core
      • AddressBase Plus
      • AddressBase Premium
      • Address Classifications
      • Addressing Lifecycle
      • OS Emergency Services Gazetteer
      • What are Vertical Streets?
      • Why are there differences in boundaries?
    • Contextual demonstrators
    • Customer best practice
      • Channel Shift
      • Data Management and OS Data Hub
      • End User Licence vs Contractor Licence
      • 🆕 IDs vs Spatial Relationships
      • Why we should capture good quality addresses at source
      • Why we Snap and Trace
    • Network Demonstrators
      • OS Detailed Path Network
      • OS Multi Modal Routing Network
        • OS Multi Modal Routing Network
      • Water Networks overview
      • OS MasterMap Highways Network and OS NGD Speeds
      • OS MasterMap® Highways Network and OS Open Roadsâ„¢
    • OS MasterMap Generation APIs
      • Using the OS Features API
      • Using the OS Features API Archive
      • Using the OS Downloads API
      • Using OS APIs in ESRI Software
    • 🆕OS NGD (National Geographic Database)
      • OS NGD Address
      • OS NGD Boundaries
      • 🆕OS NGD Buildings
        • 🆕Building and Building Access Feature Types
        • Building Part and Building Line Feature Types
      • 🆕OS NGD Geographical Names
      • OS NGD Land
      • OS NGD Land Cover enhancements
      • 🆕OS NGD Land Use
      • OS NGD Land Use enhancements
      • 🆕OS NGD Structures
        • 🆕OS NGD Structures
        • Field Boundaries
      • 🆕OS NGD Transport Features
      • 🆕OS NGD Transport Network
      • OS NGD Transport RAMI
      • OS NGD Water Features
      • OS NGD Water Network
      • OS NGD API - Features
      • Ordering OS NGD data
      • Change only updates
      • OS NGD Versioning
      • Creating a topographic map from OS NGD Data
      • Analytical styling for OS NGD data
    • OS MasterMap® demonstrators
    • 🆕Product & API Comparisons
      • 🆕Comparison of Water Network Products
  • Tutorials
    • GeoDataViz
      • Thematic Mapping Techniques
      • Downloading and using data from the OS Data Hub
      • How to download and use OS stylesheets
      • How to use the OS Maps API
      • Creating a bespoke style in Maputnik
    • GIS
      • Analysing pavement widths
      • Basic routing with OS Open Data and QGIS
      • Walktime analysis using OS Multi-modal Routing Network and QGIS
      • Creating 3D Symbols for GIS Applications
      • Constructing a Single Line Address using a Geographic Address
      • Creating a Digital Terrain Model (DTM)
      • Visualising a road gradient using a Digital Terrain Model
      • Visualising a road gradient using OSMM Highways
    • 🆕APIs
      • 🆕Using OS APIs with EPC API
      • 🆕OS APIs and ArcGIS
  • Deep Dive
    • Introduction to address matching
    • Guide to routing for the Public Sector
      • Part 1: Guide to routing
      • Part 2: Routing software and data options
      • Part 3: Building a routable network
    • Unlocking the Power of Geospatial Data
    • Using Blender for Geospatial Projects
    • A Guide to Coordinate Systems in Great Britain
      • Myths about coordinate systems
      • The shape of the Earth
      • What is position?
        • Types of coordinates
        • We need a datum
        • Position summary
      • Modern GNSS coordinate systems
        • Realising WGS84 with a TRF
        • The WGS84 broadcast TRF
        • The International Terrestrial Reference Frame (ITRF)
        • The International GNSS Service (IGS)
        • European Terrestrial Reference System 1989 (ETRS89)
      • Ordnance Survey coordinate systems
        • ETRS89 realised through OS Net
        • National Grid and the OSGB36 TRF
        • Ordnance Datum Newlyn
        • The future of British mapping coordinate systems
        • The future of British mapping coordinate systems
      • From one coordinate system to another: geodetic transformations
        • What is a geodetic transformation?
        • Helmert datum transformations
        • National Grid Transformation OSTN15 (ETRS89–OSGB36)
        • National Geoid Model OSGM15 (ETRS89-Orthometric height)
        • ETRS89 to and from ITRS
        • Approximate WGS84 to OSGB36/ODN transformation
        • Transformation between OS Net v2001 and v2009 realisations
      • Transverse Mercator map projections
        • The National Grid reference convention
      • Datum, ellipsoid and projection information
      • Converting between 3D Cartesian and ellipsoidal latitude, longitude and height coordinates
      • Converting between grid eastings and northings and ellipsoidal latitude and longitude
      • Helmert transformation worked example
      • Further information
  • Code
    • Ordnance Survey APIs
    • Mapping
    • Routing with pgRouting
      • Getting started with OS MasterMap Highways and pgRouting
      • Getting started with OS MasterMap Highways Network - Paths and pgRouting
      • Getting started with OS NGD Transport Theme and pgRouting
      • Getting started with OS NGD Transport Path features and pgRouting
  • RESOURCES
    • 🆕Data Visualisation External Resources
Powered by GitBook

Website

  • Ordnance Survey

Data

  • OS Data Hub
On this page
  • Introduction
  • What do you need?
  • Method

Was this helpful?

  1. Tutorials
  2. GIS

Creating a Digital Terrain Model (DTM)

PreviousConstructing a Single Line Address using a Geographic AddressNextVisualising a road gradient using a Digital Terrain Model

Last updated 1 year ago

Was this helpful?

Introduction

A DTM is vital for all sorts of data analysis and visualisation.

DTMs are an incredibly useful tool to have in your geospatial arsenal. For example they can be used for: The creation of 3D visualisations that will help in applications like environmental studies and town planning; Slope modelling for avalanche risk or erosion analysis; Route planning or road network design when you want to find the flattest route between two points or are planning to build a transport network; Line of sight (view shed) analysis; Water runoff plotting and flood risk analysis. And many, many more applications.

Ordnance Survey provide height information in the form of contours and spot heights in the height products Terrain ® 5 and Terrain ® 50 (Terrain 50 is open data and freely available) but there is also another format that Ordnance Survey Terrain 5 and Terrain 50 height data is supplied in; ASCII grid. An ASCII grid is like a raster image, but instead of a pixel representing a colour value as it would in a raster image, the pixel represents a height value in an ASCII grid.

What do you need?

  • A GIS. For this tutorial QGIS 3.22.4 – BiaÅ‚owieża is used

  • ASCII grid data. For this tutorial the following 12 tiles from OS Terrain 5 are used:

  • SU33NE; SU33NW; SU33SE; SU33SW; SU34SE; SU34SW; SU43NE; SU43NW; SU43SE; SU43SW; SU44SE; and SU44SW;

  • The OS Maps API light_27700 mapping was also used to add some geographic context

Method

Start a QGIS session.

Because we are processing a small area of data we can use a GIS for this so start your QGIS session and load the 12 tiles. There will be several different formats of data that will arrive with the ascii format, choose the ones that have the .asc extension and load them. Once this is done your QGIS session should resemble this:

What we want to do now is merge all of these tiles into one. However, this will create one quite big file so we'll need to compress it too. Fortunately QGIS has a lot of GDAL* tools preloaded as handy GUIs that we can use for this process.

Click on Raster > Miscellaneous > Merge

This will open the following GUI in your QGIS session but select the input layers last otherwise you won't be able select where the file saves or what compression to use!!

  1. Browse to a location that you want to save the merged image to and give it a name that explains what it is and that you'll remember. Save it as a tiff file.

  2. Select the compression from the Profile bar, select High Compression

  3. Now we can select the input layers, choose all of the imported .asc files.

Before selecting the input layers your GUI should look like this:

When you have selected all of the .asc files in your QGIS session click Run

When the process has finished (it may take several seconds depending on the number of tiles that you've selected) you will see the log file window which you can close.

Your QGIS session should now look like this:

Adjusting the local DTM height values to match national values

While this now looks very pretty, the height values that are present in this merged DTM are for the range of values that are present just for this small area and are not reflective of the range that would be present nationally.

We can remedy this by right clicking on the merged DTM in the layer pane and adjusting the Min and Max values in the Symbology tab to match those of the original .asc files:

The minimum value of 25.89 and maximum of 158.87 are those just for this small DTM, change these values to -20 and 1347 to match those of the original component .asc files. The DTM will now agree with national values so any measurements taken from the merged DTM will agree with any other tiles across Great Britain.

These national value ranges can be found under the tile numbers of the .asc file in the layer pane

The image of the DTM will now look fairly dark again but the image can be altered by right clicking on the merged layer, selecting the Properties and then adjusting Brightness and Contrast:

And that's it! You now have a DTM to use in this QGIS session!


* GDAL, or The Geospatial Data Abstraction Library is a software library that many GIS can use which allows for the reading and writing of raster and vector geospatial formats. It also allows translating and geospatial processing, reprojecting, moasaicing and tiling. It is released under the permissive X/MIT free software licence by the Open Source Geospatial Foundation. More information can be found here:

https://www.osgeo.org/projects/gdal/
The individual .asc tiles in a the QGIS session. You can just about make out a terrain image!
The Merge GUI
The filled in Merge GUI
The completed merge!
Adjusting the local DTM height values