Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Building Height Attribute data is supplied in comma-separated values (.csv) file format. Files will not be compressed.
OS MasterMap Topography Layer – Building Height Attribute is supplied as an online download. You can download data in .csv format from the OS Data Hub.
The product is currently still available for customers to request through OS Orders.
The Building Height Attribute product can be loaded into several databases. This section describes how to load it into commonly used databases, including PostgreSQL and Oracle. For more information on other databases that the Building Height Attribute product is compatible with, please speak to your OS Technical Consultant.
Further information about the Building Height Attribute product (including FAQs) can be found on the Product Support page for OS MasterMap Topography Layer on the OS website
The Building Height Attribute product can be loaded into several geographic information systems (GIS). This section describes how to load it into commonly used GIS. For more information on other GIS that the Building Height Attribute product is compatible with, please speak to your OS Technical Relationship Consultant.
The format of the TOIDs in your .csv may have an impact on how you import the .csv into a GIS. If you have not had to alter the TOID format, GIS software should read the OS_TOPO_TOID column in the .csv file as a text string automatically, which should match your OS MasterMap Topography Layer TOIDs.
Therefore, you do not have to carry out any extra steps when importing your .csv file into a GIS, so you may wish to move on to the next section.
However, if you have had to alter the OS_TOPO_TOID in the Building Height Attribute .csv by removing the ‘osgb’, this attribute may be read as a number by a GIS; this will mean that any leading zeroes added will be deleted and the TOID field in the .csv will be incompatible with the TOID field in the OS MasterMap Topography Layer data which is formatted as a text string. We have outlined some steps which will allow the user to specify the field types for .csv files being imported to some GIS environments. The processes described in the following blocks will work with individual or merged versions of the .csv data.
This getting started guide provides instructions for using OSMM Topography Layer – BHA in different software applications. Users with limited technical knowledge will be able to follow this guide.
OS MasterMap Topography Layer – Building Height Attribute is an enhancement to the OS MasterMap Topography Layer product. The enhancement is supplied in a comma-separated values (.csv) format and is supplied separately from OS MasterMap Topography Layer’s Geography Markup Language (GML) data files. Therefore, if you want to use the Building Height Attribute data, you will need to join the two files first.
No schema changes to OS MasterMap Topography Layer are required to use the Building Height Attribute data.
The Building Height Attribute dataset is derived from and dependant on multiple other data sources, so is reliant on their accuracy. In addition, if a building has multiple heights or is in close proximity to an extreme landscape change (if it is on a hill or by a river, for example), then this may affect the data quality. Multiple quality checks are made on the data before release to mitigate any errors, and confidence levels are high on the dataset, but please verify or contact OS if any of the data does not look correct.
This Getting Started Guide is designed to walk you through the steps you need to take to join the Building Height Attribute data with OS MasterMap Topography Layer data within a geographic information system (GIS). The guide also outlines how to load the data into a database.
Within this guide, there are parts showing you how to re-structure the unique topographic identifier (TOID). We would advise against this as doing so means you will be unable to confidently match the feature in the dataset to other OS products or datasets using TOIDs or OpenTOIDs as their feature identifier.
First, you will need to check the format of your TOIDs in your translated OS MasterMap Topography Layer data and compare it to the format of the TOIDs in the Building Height Attribute data. The format of the TOIDs needs to be the same so that the Building Height Attribute data can be joined with the OS MasterMap Topography Layer data. The step-by-step instructions on how to do this can be found in managing .CSV data.
If you will be using the data in a GIS, you will then need to load the Building Height Attribute data into your GIS and join it with the OS MasterMap Topography Layer data. The step-by-step instructions on how to do this can be found in loading data into a GIS and Joining to a OSMM Topography layer.
If you will be using the Building Height Attribute data in a database environment, then the data will need to be imported into a database. The step-by-step instructions on how to do this can be found in importing data into a database.
This Getting Started Guide includes the following sections:
The Building Height Attribute .csv contains the attribute OS_TOPO_TOID, which is the topographic identifier (TOID) from OS MasterMap Topography Layer. This TOID is the attribute that is used to join the data to your OS MasterMap Topography Layer data. More information about TOIDs is available in the OS MasterMap Topography Layer Product Guide and the product's Technical Specification.
TOIDs are stored in GML as a character string, with the prefix ‘osgb’, and can be comprised of either a 13-digit integer or a 16-digit integer after ‘osgb’ (for example, osgb1000001799480255). Ordnance Survey recommends that TOIDs are stored in this format.
The changing of a TOID format means that you will not be able to confidently match features with other Ordnance Survey products or with datasets created by third parties using TOIDs or OpenTOIDs as the key feature identifier. We would therefore recommend that, except where absolutely necessary, you do not make changes to the identifier format.
Some of the methods available to translate OS MasterMap Topography Layer from GML alter the TOID from the format in which it is supplied in the GML. We have tested a small sample of these methods to ascertain how the TOID is dealt with during some translation processes. The following table details how some of the translators we tested deal with TOIDs; please look at your own data to investigate how your translation process will affect the TOIDs in your data.
Translator | Processing of TOIDs |
---|---|
It is recommended that the OS_TOPO_TOID attribute in the OS MasterMap Topography Layer – Building Height Attribute .csv files be edited if it is found that the OS MasterMap Topography Layer TOID has been altered during the translation process, although how TOIDs are managed is up to your discretion. To aid this process, we have created some script that can be run alongside a gawk application that will alter TOIDs in the .csv files in two different ways. It is recommended that you create a backup copy of your .csv file before you make any changes to it.
If your TOID column requires altering the steps to do so are outlined in the importing data into a database page - detailing how this can be achieved in a database environment. This can also be achieved using the gawk process outlined below.
There are several options which will allow the user to reformat the TOID attribute before joining it with the TOID field in OS MasterMap Topography Layer.
For smaller amounts of data, the simplest option is to use the free open-source text editor called Notepad++. Using this text editor, simply load up the Building Height Attribute .csv data and then, using the search and replace option, simply replace the 'osgb' part of the TOID name with either nothing or three leading zeroes ('000'). Remember to save the file with a new name once this procedure has been carried out.
The following sub-sections detail other steps that you can take to reformat the TOID attribute in the Building Height Attribute .csv, so that the format matches that of the TOID attribute in your translated
OS MasterMap Topography Layer, Topographic Area data. The reformatting of TOID is a very quick option which will take five minutes to set up and process on a national set of data for OS MasterMap Topography Layer – Building Height Attribute.
If the format of the TOIDs in your translated OS MasterMap Topography Layer data matches that in the Building Height Attribute .csv, please skip to loading data into a GIS.
Two script reformatting options are presented below:
Script to remove ‘osgb’ from Building Height Attribute TOIDs: Recommended for use if your translator removes ‘osgb’ from your OS MasterMap Topography Layer TOIDs but does not add any leading zeroes to shorter 13-digit TOIDs.
Script to remove ‘osgb’ and add ‘000’ to 13-digit Building Height Attribute TOIDs: Recommended for use if your translator removes ‘osgb’ from your OS MasterMap Topography Layer TOIDs and adds three leading zeroes to shorter 13-digit TOIDs.
In order to use either reformatting fix, you will need to download gawk, a tool that uses pattern-matching principles to do simple data re-formatting tasks.
Download the gawk tool and save the zip file in any location.
Extract the ‘gawk.exe’ file to a directory containing the Building Height Attribute .csv file you wish to alter (this must contain only the .csv to alter and no other files). There must be no spaces in the entire file path to that directory as this will cause the process to fail.
Both reformatting processes require you to create an .awk file and a .bat file alongside the gawk application. These need to be saved in the same directory as the gawk application and Building Height Attribute .csv file you wish to alter. The structure of the .awk file specified in the following sub-section remains unchanged regardless of which of the two script reformatting options you are using. Unlike the .awk file, the content of the .bat file is different for both reformatting options. The format to use in both instances is described after the .awk file detail below.
Copy and paste the following code into a new text editor document (such as Notepad++):
Save the file as bha_fixTOID.awk in the same directory as the gawk application and Building Height Attribute .csv file.
This code refers to the file name of this .awk file. If you choose to name your .awk file differently to our suggested name, please change the code to reflect the name of the .awk
If using the first reformatting option (i.e. Script to remove 'osgb' from TOIDs), please copy the following text into a new text editor document and save the document with a .bat extension in the same directory as the gawk application, .awk file and .csv file:
This code refers to the file name of this .awk file. If you choose to name your .awk file differently to our suggested name, please change the code to reflect the name of the .awk file you are using. The .bat file does not have to have a specific name, only the .awk file has to have a specific name because the .bat file refers to the name of the .awk file.
If using the second reformatting option (i.e. Script to remove ‘osgb’ and add ‘000’ to 13-digit Building Height Attribute TOIDs), please copy the following text into a new text editor document and save the document with a .bat extension in the same directory as the gawk application, .awk file and .csv file:
This code refers to the file name of this .awk file. If you choose to name your .awk file differently to our suggested name, please change the code to reflect the name of the .awk file you are using. The .bat file does not have to have a specific name. Only the .awk file has to have a specific name because the .bat file refers to the name of the .awk file.
For both reformatting options, navigate to the directory where the .bat file is saved and execute it by double clicking the file. An MS-DOS window will appear.
Once the process is complete, press the return key to close the window.
The directory should now contain a new Building Height Attribute .csv file with the same name as the original but starting with an underscore. This .csv file will contain a copy of the original with the TOID attribute altered.
If you wish to check how this process has altered the TOID attribute, do not open the .csv file with Microsoft Excel because Excel will reformat the TOID and read it as a number field. Instead, open the .csv file in a text editor as this will keep the TOID correctly formatted.
It is likely that the user will wish to merge 5 X 5km2 tiles together to create an area of interest before loading into a GI application. The following procedure can be followed to undertake this operation:
Place all the .csv files into an empty folder.
Copy and paste the following script into a text editor (such as Notepad++), and, once copied, give the file a name which explains its function. In this case, we have called the file mergedBHAdata.bat.
Navigate to the directory where the .bat file is saved and execute by double clicking the file. This will create a new file called mergedBHAdata.csv from all the component .csv files in the folder.
Delete the original 5 X 5km2 from the folder, leaving just the newly created mergedBHAdata.csv file in the folder.
Copy and paste the following script into a text editor (such as Notepad++), and, once copied, give the file a name which explains its function. In this example, we have called the file Append_BHA_Header.bat.
Download the Building Height Attribute header file from the 'Links and downloads' section of the OS MasterMap Topography Layer Product Support page on the OS website.
Place the downloaded header file for Building Height Attribute data into the same folder as the merged Building Height Attribute data file, along with the batch file that was created in Step 4.
Run the batch file. A new merged .csv file containing the header will be created called BHA_Data.csv.
In order to use the Building Height Attribute data within GIS it must first be joined to OS MasterMap Topography Layer. This page describes this process for some commonly used GIS.
The .csv data should be loaded into your GIS with the TOID column formatted as it is in your OS MasterMap Topography Layer data holdings (see managing .csv data and loading data into a GIS pages for more details).
A join between these two datasets will link them together based on the unique identifier between the two datasets: the TOID. This will result in the buildings in your OS MasterMap Topography Layer data holdings being associated with a set of building heights.
Users should be aware that in Building Height Attribute data, features are not broken at tile edges. Therefore, once the .csv files have been merged and then joined with features in the OS MasterMap Topography Layer Topo_Area table, duplicate records will exist in the data. Depending upon which GI application is being used, tools are available within the application to remove duplicate features.
ESRI ArcGIS: In ArcGIS, use the option Geoprocessing > Dissolve to remove the duplicate features within the merged data. The output can be saved into file geodatabase, created as described earlier in this section.
QGIS: In QGIS, use the option Vector > Geoprocessing > Dissolve to remove the duplicate features within the merged data. The output will be a shapefile containing the de-duplicated data.
MapInfo Professional: There are several ways to remove duplicate features in MapInfo Professional. The following article from precisely.com details how to use the Delete Duplicates tool in MapInfo Professional to remove duplicate records but retain map objects:
OS MasterMap Topography Layer – Building Height Attribute is designed to be joined to and then used as part of the OS MasterMap Topography Layer. The guide on gives guidance on how to join this data to your Topography Layer holding.
As it is a part of the OS MasterMap Topography Layer, Building Height Attribute is designed for use in a digital map within geographic information systems (GIS) and database systems. For details of Ordnance Survey’s Licensed Partners who can assist you with incorporating Building Height Attribute data in their systems, please see the .
Ordnance Survey does not recommend either suppliers or software products as the most appropriate system will depend on many factors, such as the amount of data being taken, resources available within the organisation, the existing and planned information technology infrastructure and last but by no means least, the applications that the data will be used for. However, as a minimum, the following elements will be required in any system:
A means of reading the data, either in its native format or by translating it into a file format or for storage in a database
A means of storing and distributing the data, perhaps in a database or through a web-based service
A way of visualising and/or querying the data, typically a GIS
You are advised to copy the supplied data to a backup medium before following the steps in this guide.
For reading purposes, it is recommended that users store the data on a single hard disc as this will speed up the ability of your computer to read the data. The uncompressed file size for the full supply of Great Britain (GB) is 2.6 Gb.
Miso InterpOSe
Removes ‘osgb’ from the beginning of TOIDs and adds three leading zeroes to 13-digit TOIDs.
Astun Loader
Preserves raw GML TOID format but renames column from TOID to fid.
Pitney Bowes MapInfo
Removes ‘osgb’ from the beginning of TOIDs.
QGIS
Preserves raw GML TOID format.