Draping with OS Terrain

Over the past month at work I have worked on a number of different projects which involved draping maps, geodata and imagery over our OS Terrain height products.

Having met my customer’s requirements I decided to use the data to create a better example piece for this tutorial on terrain draping. My intention here isn’t to create a tutorial for a specific software, or to be open-friendly. I wanted to share with you the best way I currently have of doing it at work: So something real. This happens to involve a mixture of ArcGIS and QGIS with Adobe Photoshop and Illustrator used for the finishing.

I have used OS Terrain 5 and OS MasterMap Imagery Layer; but you could try with open products such as OS Terrain 50 and whilst imagery is harder to find, try NASA Earth Observatory for a sample area, or depending on your location check out this list provided by OpenStreetMap (OSM). Or you could always drape some map or geo- data instead.

The first choice when using Ordnance Survey’s terrain data is whether you want the gridded heights or the contours and spot heights. Some software used to have issues with the ascii grids (gridded heights) so I used to always take the contours and spot heights, add any water data and create a TIN.

CreatingTIN

There is now no real need for this method when draping. Most software reads the ascii grids and with OS Terrain 5, water was taken into account in their creation (along with significant landscape features such as roads, railways, quarries and lakes). Working with the grids is also quicker as it is less memory and processor intensive.

Once you have your data, then assuming your area is greater than 1km, your first task is to merge together the ascii grid files. Doing this ensures that the maximum and minimum will be consistent across the area and also that there will be no gaps. Most importantly, merging at the start makes the draping process easier later on.

 

Step 1 – Merging gridded height data

So this is where I make my first software decision. And QGIS is my software of choice for merging ascii grid files. It is quick and effortless. It does however work by running a simple GDAL command line so if you are a happy coder then you may prefer to just use GDAL instead.

Open QGIS, there is no need to add any data, and from the menu bar across the top, go to Raster_Miscellaneous_Merge.

MergeAscii

In the Merge window that opens, navigate to ‘Input files’ and click the button to the right that says Select….

MergeAscii2

Navigate to and select the ascii files that you wish to use and click Open. Next, under ‘Output file’ you need to simply insert, or use the Select… button to find, the filepath of where you wish the merged ascii output file to be saved. Keep the default settings for the rest and you should end up with a window similar to the screenshot below.

MergeAscii3

At the bottom you will see the GDAL command. To run this simply click on OK. Once it has run click on Close. If you click on OK it will simply run it again.

 

Step 2 – ‘Merging’ imagery

Now we have merged our height data, the next thing to merge is our imagery. Rather than actually stitch any rasters together, all we need to do is build a raster catalogue.

So now we choose our next ‘best tool for the job’. And in this case I use ArcCatalog. I do this step in ArcCatalog because it is far more stable than ArcScene. It could be my imagination but it seems to me to be quicker as well.

So open up ArcCatalog and navigate to your working folder. Right click in white space within the folder and choose Create new File Geodatabase (unless you wish to use an existing one).

Then right click on the new (or existing) file geodatabase, and choose New_Raster Catalog…

ArcCatalog1

In the dialogue that opens, give it a name, a coordinate system (in my case British National Grid) and choose ‘Unmanaged’.

ArcCatalog2

Once you have okayed this, you will once again see your file geodatabase. Double click on the icon for this. Inside you will see your new raster catalog. Right click on this and select Load Raster Datasets…. Select the required images and click on Add.

ArcCatalog3

Then click on OK to run the Raster to Geodatabase tool which will add the images to the catalogue. Once processing is complete, the catalogue will have been made and you can now close down ArcCatalog.

 

Step 3 – Draping imagery over terrain

So now we have our imagery and terrain prepared, we can begin draping. There is quite a cool and relatively new plugin for QGIS called Qgis2threejs that I have been using which exports an interactive html model but functionality is currently quite limited for example there is not lighting or shading option. There is also something called Nviz which I haven’t yet explored. So for now I generally stick with Esri ArcScene.

ArcScene has its many issues so save your work regularly as it will crash even more regularly! I am only speculating but it seems to me that it is using memory cumulatively and never clearing its cache; so saving, exiting and restarting is also a good trick. There is also an issue with exporting which I will come onto later. Esri seem to blame everything with ArcScene on the Windows rendering engine.

Anyway, start up ArcScene and click on the Add Data button on the menu bar. Navigate to and add your raster catalogue from earlier.

ArcScene1

As well as a plane view of the imagery, you will notice that the layer has been added to the table of contents, just like in ArcMap (or any other form of ArcGIS).

ArcScene2

Right click on the layer and choose Properties. Under the Display tab, change the display type to Cubic Convolution. Bilinear is usually better for mapping, or Nearest Neighbour for an indexed raster. Select the Base Heights tab and under ‘Floating on a Custom Surface:’ click on the folder icon and navigate to and select your combined ascii file from earlier.

ArcScene3

Then click on Raster Resolution…. For imagery we want to keep the Base Surface relatively low resolution otherwise ArcScene will not draw or will crash. This is somewhat understandable if you consider how high the resolution is of the OS MasterMap Imagery that I am rendering. For Imagery Layer, a cell size of about 30 is usually sufficient. For raster map data, try to increase the resolution (decrease the cell size) to nearer to the Original Surface values. Be warned, if you go too high the image might look pixelated through being too detailed as opposed to not good enough resolution.

Next, click on the Rendering tab. Ensure the settings are as in the image below.

ArcScene4

Press OK and you have draped imagery!

If you wish to exaggerate it, I have recently learned that it is better to do this in the document settings by clicking on Scene Layers in the Table of Contents, than it is by editing the setting in the layer itself. Doing it on layers has a bug when working with vectors.

Now you can add any vector data over the top. For example I added footpaths, tracks and some roads from OS MasterMap Topography Layer. Just go to Add Data, find your vectors and once loaded in right click on layer properties. Style as you wish with the Symbology tab and then under the Base Heights tab, do just as before, selecting the same surface. Up the raster resolution and most importantly add a layer offset of say 0.5m. This prevents the vectors from clashing with the rendered imagery (or map).

ArcScene5

ArcScene will rasterise any vectors and it can look quite ugly.

ArcScene6

So I decided to take two versions out: One with the paths and one without. Then I could manually redigitise the paths to create a far cleaner, crisper output.

So how to export from ArcScene?!

Well you are supposed to go to the menu bar and choose File_ExportScene. And the 3D export will allow you to export your model into a 3D package such as SketchUp. However, I have already done all the 3D work in ArcScene and all I wanted out was a 2D representation of my draped terrain.

So under the Export Scene option there is a 2D export. I have tried all of the settings and the quality is really, really bad! Thankfully I have a very high resolution monitor at work, so all of my 2D exports from ArcScene are simply done as screendumps. Hit print screen and paste into Adobe Photoshop.

Snowdon_drape_sm

The output quality is far superior. Whilst in Photoshop I also added a faux sky to my model.

Next I loaded both the images (with and without paths) into Adobe Illustrator. I manually digitised over the paths with the pen tool, once done I discarded the image with the paths, saved out the work as PNG and here is the final result :-)

Ordnance Survey. © Crown Copyright 2014 and © Christopher Wesson 2014. All rights reserved.
Ordnance Survey. © Crown Copyright 2014 and © Christopher Wesson 2014. All rights reserved.

Using the same process I also created this image of Ben Nevis which also includes a sample of OS 1:25 000 Scale Colour Raster.

Ordnance Survey. © Crown Copyright 2014 and © Christopher Wesson 2014. All rights reserved.
Ordnance Survey. © Crown Copyright 2014 and © Christopher Wesson 2014. All rights reserved.

 

See both these images in full resolution and more examples of the work of me and my colleagues on our Flickr set on the Ordnance Survey Flickr account.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Follow

Get every new post on this blog delivered to your Inbox.

Join other followers: