QGIS

Accessing OS NGD API - Tiles via QGIS

QGIS is an open GIS (Geospatial Information System) desktop application that allows you to display, interrogate, visualise and create geospatial information including from geo-centric APIs (for example, a Vector Tiles Service).

What you'll need

  • QGIS (version 3.22.0 or later)

Instructions

Open a blank document in QGIS. Uncheck the "Render" box for now.

Navigate to Layer → Add Layer → Add Vector Tilers Layer...

The following window will be displayed:

Click the New button below the drop-down menu and select New Generic Connection

The window that pops up requires the API information you obtained in the OS Data Hub.

Provide the service details of the API as follows:

  1. Provide a name for the API. It is good practice to name your connections in a way that makes them instantly recognisable.

  2. In the URL box, input the OS NGD API - Tiles URL to retrieve tiles for your preferred collection.

  3. Your API Key, which has been generated in the OS Data Hub.

  4. Set the Min and Max Zoom Levels based on your preferred projection.

    • Web Mercator (EPSG: 3857): Min Zoom = 6, Max Zoom = 19

    • British National Grid (BNG: EPSG: 27700): Min Zoom = 0, Max Zoom = 15

  5. In the Style URL box, input the OS NGD API - Tiles style URL to style the tiles based on the default style for the specified collection.

  6. Leave all other options blank and click OK.

To retrieve tiles and style them appropriately, you will need two URLs. The URLs have slight variations based on the collection ID and projection. Here are some example URLs to retrieve the basemap (ngd-base) in Web Mercator (EPSG: 3857):

Please note: You will need to replace the /{tileMatrix}/{tileRow}/{tileCol} used in the default 'retrieve tile' URL with /{z}/{y}/{x} to be able to connect to the OS NGD API - Tiles.

Click Add and Close in the Data Source Manager and you'll see the map displayed in the QGIS screen

Last updated