These instructions are based on QGIS version 3.22.4 and assume you have set the default coordinate reference system to British National Grid (EPSG 27700).
To load and display GML data in QGIS:
Open an existing project or create a new one.
In Layer, click Add Layer > Add Vector Layer.
In the Data Source Manager dialog:
Vector > Source > Vector Dataset(s): Click …, navigate to and select the GML file on your computer.
Click Add.
In the Select Items to Add dialog, select one or more site layers and click Add Layers.
Close Data Source Manager.
Your GML data now displays in both the Layers panel and map area. The data is un-styled and will look similar to the following image:
Layers panel:
Data is typically grouped by tile reference.
If you open both the point (AccessPoint and RoutingPoint) and polygon (FunctionalSite) layers, you may need to reorder the layers to see the data in the map area. Use drag and drop to do this.
If you are dealing with multiple tiles of 5 km² OS MasterMap Sites Layer data, consider converting your data to another format (for example, shapefile) as GML data does not always merge seamlessly.
Rendering performance of GML data in QGIS is not as good as other formats (for example, shapefiles), because GML data cannot be spatially indexed.
The sections that follow show you how to convert GML data to shapefile and how to apply a spatial index to shapefiles.
To convert GML to shapefile in QGIS:
In the Layers panel, right-click on the layer you want to convert and click Export > Save Features As....
In the Save Vector Layer as… dialog:
Format: Select ESRI Shapefile.
File name: Click …, navigate to the folder in which you want to store the shapefile, name the file, and click Save.
Click OK.
When you click OK, QGIS creates a shapefile from the exported GML file and saves it to the selected folder.
Repeat steps 1 and 2 for each layer you want to convert. For example, for the other layers of the 5km² OS MasterMap Sites Layer data.
When working with shapefiles, we recommend you apply a spatial index to the data, particularly when loading large or national sets of data. This significantly improves performance when rendering and panning the data.
To apply a spatial index to a shapefile in QGIS:
In the Layers panel, right-click on the layer you want to index and click Properties.
In the Layer Properties dialog:
Source > Geometry: Click Create Spatial Index and then click OK when the process is complete to close the success confirmation dialog.
Click OK.