QGIS

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).

Loading and displaying the GML supply

To load and display GML data in QGIS:

  1. Open an existing project or create a new one.

  2. In Layer, click Add Layer > Add Vector Layer.

    QGIS UI showing Layer > Add Layer > Add Vector Layer menu option.
    QGIS UI showing Layer > Add Layer > Add Vector Layer menu option.
  3. 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.

      QGIS Select Items to Add dialog displaying the AccessPoint, FunctionalState and RoutingPoint layers for selection.
  4. 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:

QGIS UI showing the AccessPoint, FunctionalState and RoutingPoint layers GML data displayed in the Layers Panel and map area.
QGIS UI showing the AccessPoint, FunctionalState and RoutingPoint layers GML data displayed in the Layers Panel and map area.

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.

Converting GML to shapefile

To convert GML to shapefile in QGIS:

  1. In the Layers panel, right-click on the layer you want to convert and click Export > Save Features As....

    QGIS Layers Panel showing Export > Save Features As menu option.
    QGIS Layers Panel showing Export > Save Features As menu option.
  2. 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.

QGIS Save Vector Layer as... dialog.
QGIS Save Vector Layer as... dialog.

When you click OK, QGIS creates a shapefile from the exported GML file and saves it to the selected folder.

  1. 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.

Applying a spatial index to shapefiles

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:

  1. In the Layers panel, right-click on the layer you want to index and click Properties.

    QGIS Layers Panel showing Properties menu option.
    QGIS Layers Panel showing Properties menu option.
  2. 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.

      QGIS Layer Properties dialog showing Source > Geometry > Create Spatial Index button.
      QGIS Layer Properties dialog showing Source > Geometry > Create Spatial Index button.

Last updated

Was this helpful?