In March 2014 Ordnance Survey (OS) published an alpha release of the much anticipated Building Height Attribute (BHA) dataset, which is an enhancement to OS MasterMap Topography Layer. You can read all about it in their blog post. In this blog we’re going to show you how to integrate the BHA dataset with buildings in the OS MasterMap Topography Layer to create a heighted buildings dataset and visualise it in 3D. We used ArcGIS 10.2 and ArcGlobe to do this but other software could be used.
The first alpha release of BHA included buildings covering approximately 8,000km2 of the country. A second alpha release of BHA was published in July 2014 which covers around 10,000km2 of the major towns and cities in Great Britain. OS publish an interactive map which shows the extents of the areas covered by the alpha release, so you can check if your area of interest is included.
A note of caution, this is an alpha release of the data and OS do not guarantee that BHA is error free or accurate. Additionally the dataset is not subject to update and maintenance. However in time OS intend to include BHA in OS MasterMap Topography Layer so in future it will be supplied and maintained as a part of the Topography Layer.
Attributes supplied by OS
A number of attributes are provided for each building as shown in the image :
- ground level [AbsHMin]
- the base of the roof [AbsH2]
- highest part of the roof [AbsHMax]
Using these three values two additional relative heights are calculated:
- relative height from ground level to the highest part of the roof [RelHMax]
- relative height from ground level to base of the roof [RelH2]
OS publish the data as a single CSV file containing over 20 million records. This is a very large dataset and can cause data management problems in a desktop environment so EDINA have split the dataset up using the OS 5km grid allowing you to download the data in tiles for your study area. The data is available in CSV and KML formats. To use the data in GIS or CAD packages you should download the data in CSV format; KML is used to visualise the data in Google Earth.
The ‘Show Grid/Overlay’ menu on the right hand side in the Data Download application displays the OS 5km grid. This will draw a grid with each square containing the OS 5km tile reference, as shown in the image.
Please note: BHA data is not currently available for the whole country, you should consult the interactive map published by the OS to see if data exists for your area of interest.
Using the data
OS provide an excellent Getting Started Guide which explains in detail the process of getting BHA data in to GIS for subsequent analysis. The main steps are described below but please refer to the Getting Started Guide for full details.
The data is supplied as CSV files. Each record in the file has a unique TOID which can be used to join the data to building features in OS MasterMap Topography Layer.
- Download OS MasterMap Topography Layer data for your area of interest from Digimap using the OS Data Download application. Select the ‘File Geodatabase’ format for your data as this is a native ArcGIS format and doesn’t require any conversion.
- Download BHA data for your area of interest from Digimap using the OS Data Download application (BHA data is found in the ‘OS MasterMap’ group), selecting CSV format.
- Open the OS MasterMap Topography Layer data in ArcGIS.
Preparing BHA data for use
If your downloaded BHA data is made up of more than one CSV file we recommend merging them all together in to a single CSV file first to make subsequent processing easier and quicker. Use a text editor such as Notepad or TextPad rather than Excel, as Excel can change the formatting of numbers which contain leading zeros.
Each object in MasterMap Topography Layer have a unique identifier called a Topographic Identifier, or TOID for short. TOIDs supplied by Ordnance Survey take the format of a 13 or 16 digit number prefixed with ‘osgb’ e.g. ‘osgb1000039581300′ or ‘osgb1000002489201973′. ArcGIS automatically strips off the ‘osgb’ prefix and adds three leading zeros to any TOID that has only 13 digits to make them all 16 characters long. In order to make it easier to join BHA data to building features in MasterMap Topography Layer the BHA files supplied by EDINA have two TOID values:
- os_topo_toid_digimap is the TOID formatted to match TOIDs in ArcGIS
- os_topo_toid is the original TOID as supplied by Ordnance Survey (this should be used in other GIS packages such as QGIS which do not modify the TOIDs in MasterMap Topography Layer)
Before BHA data can be loaded in to ArcGIS it is necessary to create a small text file (called schema.ini) that specifies the data type of each field so that ArcGIS handles it correctly. Specifically the schema.ini file is used to ensure that ArcGIS treats the two TOID values as text rather than numbers. The steps required are detailed below:
- Create a new file called schema.ini in the same folder as the BHA csv file you wish to import.
- Open the file in a text editor such as Notepad or Text pad.
- Copy and paste the following text in to the file:
- The first section of code, in square brackets shown in red above, refers to the name of the csv file you wish to import. You should modify this filename so that it references your BHA csv file.
- Save your changes to the file. Ensure it is called schema.ini and is saved in the same folder as the csv file you with to import.
- Add your BHA csv file to ArcGIS through the Add Data function; this will add the data as a table in the map document.
Creating a heighted buildings dataset
In order to create a new heighted buildings dataset from the building features in OS MasterMap Topography Layer and the BHA data we use the GIS ‘join’ function. A join links these two datasets together through a common unique identifier (the TOID) resulting in a set of buildings with height values stored as additional attributes.
- Right click on the Topographic Area layer in the table of contents > Joins and Relates > Join. This will bring up the Join Data window which can be completed as shown. Remember to join to the TOID in the csv file that is formatted to match the TOIDs displayed in ArcGIS (os_topo_toid_digimap).
Tip: to create a dataset which just includes the heighted buildings select ‘Keep only matching records’.
- Having joined the datasets together we can then export the result as a new Feature Class in our File Geodatabase for subsequent use and analysis. This is done by right clicking on the Topographic Area layer in the table of contents > Data > Export Data… give your new dataset a suitable name and select your existing File Geodatabase as the destination.
Visualising the result in ArcGlobe
So far we have downloaded data from OS MasterMap Topography Layer and BHA data for the same area and joined the two together to create a new dataset containing just the building features which now include the various height attributes published by OS. Now the fun begins!
We can easily visualise the heighted buildings dataset in 3D using ArcGlobe or ArcScene. The following steps describe how to import the data in to ArcGlobe.
- Download the OS Terrain 50 DTM for your area of interest from Digimap using the OS Data Download application. This will be used as the base (ground) heights for the area to provide a more accurate terrain model than is available by default in ArcGlobe.
- Open ArcGlobe and add in the DTM. You will be asked if you wish to use the DTM as and ‘image source’ or an ‘elevation source’. You should select the ‘elevation source’ option:
- The Geographic Coordinate Systems Warning dialog will appear as OS MasterMap Topography Layer data is in a different coordinate system (British National Grid) from that used by ArcGlobe (WGS 84):
- You should specify the transformation used to ensure that the data is accurately positioned on the globe. Using the Transformations… button you should specify the ‘OSGB_1936_To_WGS_1984_Petroleum’ transformation:
- Adding your heighted building dataset from your File Geodatabase is achieved through the Add Data button. Once added you may need to zoom to the layer to view it: right click on the layer in the table of contents > Zoom To Layer.
- By default the data is not extruded vertically so appears flat on the earth’s surface. To visualise the buildings in 3D right click on the layer in the table of contents and select Properties and then click on the Globe Extrusion tab.
- Select the ‘Extrude features in layer’ checkbox and then in the ‘extrusion value or expression’ box enter the following:
[relh2] * 1.5
This will extrude the buildings using the RelH2 attribute with a vertical exaggeration of 1.5 times (i.e. buildings will be shown 1.5 times their actual height). We found using RelH2 (the relative height from ground level to base of the roof) provides a more useful visualisation over RelHMax (the relative height from ground level to the highest part of the roof) which can lead to some overly tall looking buildings where they include towers that extend significantly beyond the height of the rest of the roof.
The end result
The image below shows an area of Edinburgh including Edinburgh Castle with Arthurs’ Seat in the background. Aerial imagery from ArcGlobe is draped over OS Terrain 50 data for the region with heighted buildings drawn on top. Using the tools in ArcGlobe it is easy to explore the landscape, navigating across the surface and examining the relationships between buildings in the built environment.
OS published Release Notes for the alpha releases of BHA. Additional information can be found in Annexe D of the OS MasterMap Topography Layer User Guide and Annexe E of the OS MasterMap Topography Layer Technical Specification.