USING ELEVATION DATA FOR GREAT BRITAIN - A TUTORIAL
I'd like to start by thanking qwerty42, crispy136 and TomSimMuc for their tutorials on the USA, Australia and Norway respectively. I'd never have been able to come up with this stuff on my own without having previously studied their methods.
WHAT YOU WILL NEED BEFORE YOU START
- Aerofly SDK tools (inc Geoconvert)
- QGIS version 2.14.21 (Essen) - available here. [I can't figure out how to make it work with the latest version.]
- The mesh_conv.tmc & mesh_conv.bat files - as for any other region. (qwerty provided these in his tutorial package.)
- Some means of knowing where the Aerofly tiles are in terms of latitude and longitude. I use my own spreadsheet (with formulae courtesy of rodeo) but I believe there is another tool available for download on this forum? AeroScenery is also helpful for this purpose.
DOWNLOADING THE DATA
Broadly speaking there are 2 different types of free data available for GB. I'll say a little about them and explain how to download them. The data is usually organised by Ordnance Survey 100 x 100 km grid squares, which have 2-letter name such as SU, TQ, NY etc and are further subdivided using numbers. There's an explanatory map here. Both types of data are in the same format (.asc files) so the PROCESSING THE DATA section which follows is the same for both.
1. Ordnance Survey 50 m data "OS Terrain 50" This data is complete for the whole of England, Wales and Scotland and can be downloaded all in one go.
- Go to: Ordnance Survey: OS Terrain 50.
- Select ASCII grid and GML (grid) in the supply format menu.
- Tick download, then scroll to the bottom of the page and click continue.
- Fill in the form and you will be sent an email with a download link.
- Download and unzip. The unzipped folder contains the .asc files grouped according to OS squares.
- You may not be particularly interested in this data since higher resolutions are available, but it is actually a considerable improvement on the default mesh and can be used to cover large areas very quickly. [UPDATE: I'm getting occasional faults (deep trenches) which I think are caused by this data. This is surprising since it comes from the Ordnance Survey. I've corrected the faults by deleting the odd level 11 TTH tile here and there.]
2. High res data from various sources (2 m, 1 m, 50 cm and 25 cm) This type of data tends to have a lot of "holes" in it and coverage may be far from complete. There are full details below on how to download the English data plus links to the Scottish and Welsh data.
- For the English data go to: DEFRA Data Download
- Zoom in on the map until you see the squares and click the down arrow at the top right so that you get the Download your data panel.
- Select an area using the freehand drawing tool. You really want a square or squares but the only way of selecting them seems to be to draw a rough circle around them to begin with. The squares are 5x5 km, so a level 9 sized area is roughly 100 squares. However the site won't allow you to select that many in one go.
- Click get available tiles. There are 3 drop down menus here with a variety of choices, so feel free to experiment. In the end I chose LIDAR composite DTM from the top menu and DTM 1M from the bottom menu. The DTM 2M data has slightly better coverage - but there's not a lot of difference. The DSM options are probably best avoided - they just seem to give random lumpiness in built up areas.
- Click your square(s) on the list, download and unzip.
- This data is excellent where it exists but you'll need to avoid geoconverting the "holes" otherwise you'll get flat areas at sea level in your landscape, which is not a good look.
- Scotland: (1) Scottish Govt: Remote Sensing Data (GeoTIFF format - ie different but simple enough to process - coverage rather sparse) (2) More Scottish data (.asc format - sparse coverage)
- Wales: Lle Geo-Portal for Wales (.asc format - similar coverage to the English data)
Ordnance Survey 5 m data OS Terrain 5 looks promising since it is complete for the whole of Great Britain. However, when I made enquiries about obtaining a free "Data Exploration Licence" Ordnance Survey told me that the licence was only intended for commercial users who might eventually become paying customers.
News is that ORBX are working on GB scenery. However the mesh creation I describe isn't really wasted effort because you will be able to combine the 1 metre etc mesh with ORBX's mesh (which will probably be either 5 or 10 metre.)
PROCESSING THE DATA
Whichever of the above data sources you use, you will end up with a large number of .asc files - so from here onwards the procedure is similar for all the data types. The first step in the procedure is "merging" them. You need to do this so that they form a big enough heightmap to be worth geoconverting. QGIS won't let you merge more than about 100 .asc files at a time, but you can always merge them in batches and then merge the resulting TIFs if you want a bigger area. If you find that the .asc files are in multiple folders you can use Windows search (for example) to find them all, copy them and put them all in one place. (Search for "asc".) This makes life easier when you do the merging.
- Open up QGIS and select Raster > Miscellaneous > Merge.
- Click the input files select button, navigate to the folder where you have your .asc files and select all the ones you want to merge. You also have the option here to choose input directory instead of files and to check recurse subdirectories. Like "search", this is also useful if the .asc files are in multiple folders.
- Click the output file select button, give your file a name and choose somewhere to save it.
- Click OK and wait. The Coordinate Reference System Selector box should appear after a short while. When it does appear, choose OSGB 1936 / British National Grid EPSG:27700 from the long list of CRS's in the 3rd panel and click OK in that box. [You can use the filter to search for it. After you have used the CRS once it will subsequently always appear in the 2nd panel from the top.] The merging should then go ahead to completion. You should see a heightmap in the main QGIS canvas when you've closed all the boxes obscuring it (OK, OK and close). [If you are using 1m data etc this is the point where you'll be able to spot the "holes". They show up as completely black areas in the heightmap.]
- Right click on the bold, underlined title of your merged file in the bottom left panel of QGIS, and select save as. In the save as box you should have: output mode = raw data and format = GTiff - but you need to change the CRS now to Default CRS (EPSG:4326 - WGS 84). You should now see latitude and longitude values in the extent panel below, and resolution values in the panel below that. Use Browse to enter a name for your merged file and choose a place to save it. Click OK to save.
- 1 metre etc data only: The 1 m data has lots of black (no data) areas in it, so you need to crop rectangles of good data from a TIF of level 9 size or larger, avoiding all the "no data" areas. (1) In QGIS: select layer > add layer > add raster layer. (2) Select the merged TIF that you saved as ESPG:4326. (3) Select raster > extraction > clipper. Select a destination for your output file and give it a name. Clipping mode = extent. Select a good rectangle from your Geotiff. Click OK and wait for the processing to finish. (4) Repeat 3 until you have selected all the good bits of your geotiff. You may end up with dozens of cropped bits of geotiff. (5) Select raster > conversion > translate, Check batch mode. The input directory is where you have your multiple cropped geotiffs. Output directory = input_aerial_images. Check creation options, click "+" and type "tfw" under name and "yes" under value. (6) Click OK and you should end up with all your cropped TIFs and corresponding TFW files in the input_aerial_images folder ready for geoconversion.
- 50 metre data only: Follow steps (5) and (6) above, except that you only have one TIF (probably) and only want to produce one TFW file.
- Edit your mesh_conv.tmc in the usual way. I assume people have some knowledge of this, but if you don't I can point you in the right direction. If you are doing a whole level 9 or 10 tile then you can use your preferred method of snapping to that tile area. I actually use Aeroscenery to get the level 9 tile co-ordinates for the .tmc file. I tick generate AID/TMC files and then copy and past the 2 lines of code that contain the coordinates from the Aeroscenery TMC into the mesh_conv.tmc. I also go to settings > geoconvert in Aeroscenery and change shrink TMC grid square by from 0.01 to 0.005 degrees. (I find that with 0.01 I sometimes have missing tiles.) The default mesh already has level 7-10 elevation (TTH) tiles. My current thinking is to use the 50 m data to create level 11 tiles for the whole terrain, and the 1 m data (where it exists) to create levels 12, 13 & 14. (Obviously many of these latter files will be masked because they come from lots of cropped geotiffs.) Anyway, the principle is to use separate levels for different resolutions.
- Finally double click your mesh_conv.bat to run Geoconvert, and your TTH files should appear in the scenery\images folder as usual.
- You can put the TTH files here: C:\Users\yourname\Documents\Aerofly FS 2\scenery\elevation - or you may have some alternative place for them. (I personally have them on the D-drive now.)