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.
ArcMap
These notes outline how to join Building Height Attribute data to OS MasterMap Topography Layer in ArcMap. The notes have been prepared using version 10.5 of ArcMap.
In the procedure described below, it is assumed that the user has converted OS MasterMap Topography Layer from the .gz supply into an ESRI shapefile format using translation software. It is important to ensure that any pre-processing of Building Height Attribute data is completed before commencing an ESRI ArcGIS session.
Launch ArcMap and load the Building Height Attribute .csv file and the OS MasterMap Topography Layer shapefile.
Right-click on the Topographic Area Layer in the table of contents, navigate to Joins and Relates and select the Join… option as shown in the following screenshot:
In the Join Data dialog box that opens, select the .csv file you want to join to the OS MasterMap Topography Layer data from the drop-down under option 2 in the list.
For options 1 and 3 listed in the Join Data dialog box, select the TOID column in each dataset to specify this as the common attribute between the data that you wish to join on.
In the Join Options section of the Join Data dialog box, you can choose to keep all records or keep only matching records; this will mean that you will only have the buildings with heights left after the join.
Select OK to carry out the join – it is better not to choose the Validate Join option as this requires a longer processing time.
When you open the attribute table of the layer you have joined the .csv file to, you should see the Building Height Attribute columns at the end of the attribute table. You can use the 'Select by attribute tool' to display all the buildings in the attribute table to inspect the Building Height Attribute data more easily in ArcMap. If you experience long processing times when querying this join, please export the file and then carry out these queries.
Lastly, in order to save this join to the layer, close the attribute table and right-click the layer in the table of contents. Select Data > Export Data to save a copy of this shapefile with the Building Height Attribute data joined to it. Please be aware that large volumes of data may increase the processing time of this step.
Alternative method to speed up the join process
If you are finding that the join process is taking a long time, you can try the alternative method outlined below which will speed up the join.
Before loading the .csv file into the GIS, you could use ArcCatalog to export the .csv table into a Geodatabase (single). When doing this, you will have the option to edit the format of the field properties for the TOID data. This will allow you to add an attribute index to the table. Once the index has been added, the join process should be quicker. The notes below outline these steps fully:
Navigate to the .csv file in ArcCatalog.
Right-hand click on file and select the drop-down Export, then choose To Geodatabase (single). This will open up the Table-to-Table dialog box.
Select an output location, which needs to be within a file geodatabase, and create a name for the new table you are going to create.
Finally, in the Field Map (optional) window, right-click on the TOID field and select the Properties option, which will open the Output Field Properties dialog box.
In the Properties box, there will be a row called ‘Length’ with a number. This number has to be less than 80 to allow you to add an attribute index later in the process. As TOIDs are never more than 20 characters in length, this number has to be greater than 20.
Click OK to close the window.
To complete the export, select OK.
Open up ArcGIS and navigate to the Arc Toolbox.
Select Data Management Tools, then choose Indexes from the drop-down and open the Add Attribute Index tool.
Select the table in the File Geodatabase you have just created. In the ‘Fields to Index’ window, tick the box next to the row which contains the TOID.
Select OK to carry out this operation.
Once the index has been added, carry out the instructions at the beginning of the section to join the Building Height Attribute data to your OS MasterMap Topography Layer data.
QGIS
These notes outline how to join Building Height Attribute data to OS MasterMap Topography Layer in QGIS. The notes have been prepared using version 2.14.15 of QGIS Desktop. The instructions will also work for version 3.16 of QGIS.
Launch QGIS and load the .csv file and the OS MasterMap Topography Layer data.
Right-click the Topographic Area Layer and select Properties from the options list.
Click the Joins tab within the Layer Properties dialog box.
Press the green plus icon at the bottom of this dialog box, and in the Add vector join dialog box that opens, select the .csv file as the Join layer.
For the Join field and Target Field options in the Add vector join dialog box, select the TOID column in each dataset to specify this as the common attribute between the data you wish to join on.
Select OK, then close the Layer Properties dialog box.
When you open the attribute table of the Topographic Area Layer, you should see the Building Height Attribute columns at the end of the attribute table. You can use the Select features by expression tool to display all the buildings in the attribute table to inspect the Building Height Attribute data more easily in QGIS.
Lastly, in order to save this join to the layer, close the attribute table and right-click the layer in the table of contents. Select Save as from the options list to save a copy of the layer with the Building Height Attribute data joined to it.
MapInfo
These notes outline how to join Building Height Attribute data to OS MasterMap Topography Layer in MapInfo. The notes have been prepared using version 12.0.2 of MapInfo.
Launch MapInfo and load the .dbf file and the OS MasterMap Topography Layer .TAB file.
Select the SQL Select button on the ribbon toolbar, and choose the SQL Select option which opens the SQL Select dialog box. Leave the ‘*’ (asterisk symbol) in the Select Columns box to preserve all fields in both tables.
From the Tables drop-down, select the OS MasterMap Topography Layer data and the .dbf file you wish to join. This will populate these tables within the 'from Tables' box.
Click within the 'where Condition' box, then select from the Columns drop-down the TOID field from the OS MasterMap Topography Layer data. This will populate this field within the 'where Condition' box.
Enter an equals sign after this column name and then use the ‘Columns’ drop-down to select the TOID field from the .dbf file which will populate this field after the equals sign in the ‘where Condition’ box. This action will have written the SQL query to join these tables via the TOID columns; the SQL query should look similar to that shown in the preceding screenshot.
In the ‘into Table Named’ box, enter the name you wish to call the new table containing both the OS MasterMap Topography Layer data and .dbf file data.
Click OK to close the SQL Select dialog box.
A new table will open containing the joined records.
Select the Files drop-down from the top toolbar, then choose the Save Query option to save this join.
If you close the query table and open the version you have saved, a map view of the join will open in a window browser. Please be aware that as you are dealing with large files, these steps may take some time to process.
Dealing with duplicate records
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: