Configuring QGIS to use OS Maps API WMTS/WMS base maps

Configuring QGIS to use OS Maps API WMTS/WMS base maps

Add OS Maps API WMS service via Astun Data Services

When using QGIS, we recommend utilizing the WMS service through Astun Data Services. This typically provides superior display clarity compared to WMTS across all scales.

ADS provides you with all of the standard OS Maps API styles as a WMS plus the following enhanced styles: Leisure style with additional zoom-levels down to large-scales, Dedicated Leisure 25k and 50k styles, Grayscale versions of Road, Outdoor, Light and Leisure.

  1. Open QGIS and from the Browser section right-click on the WMS/WMTS node and click New Connection:

    X0dGepm91d.png

     

  2. In the Create a New WMS/WMTS Connection panel:

    1. Give the service a clear name such as OS Maps API WMS base maps via ADS.

    2. In the URL field enter the following URL https://map.services.astuntechnology.com/your-organisation-goes-here/osmaps/service?REQUEST=GetCapabilities&SERVICE=WMS&key=your-API-key-goes-here and replace the API key and the organisation placeholders with your API key and your organisation name.

    3. In the WMS/WMTS section set the:

      1. The WMS DPI-Mode to off.

      2. The WMTS server-side tile pixel ratio to Standard (96 DPI).

        Photos_GLlwwzN0BE.png
    4. Click OK.

    5. Now you are ready to use the base maps.

      qgis-bin_1lr55sG1Or.png

       

Add OS Maps API WMTS service either from OS or Astun Data Services

According to the Open Geospatial Consortium (OGC), the WMTS standard complements the existing WMS standard by allowing clients to request specific image tiles from a server in a standardized way. Those tiles have predefined content, extent, and resolution in comparison with the tiles that are coming from a WMS server that dynamically renders the tiles on the fly.

When viewing a WMTS map in QGIS at a scale that doesn’t correspond with one of the predefined WMTS scales (TileMatrix), QGIS will draw tiles from the nearest WMTS scale and resample them. This can result in reduced display clarity.

Add OS Maps API WMTS service via OS

You can directly request the following mapping styles from the OS Maps API: Leisure, Light, Outdoor, and Road. The Leisure base map is available in the EPSG:27700 (British National Grid) projection while Light, Outdoor, and Road are available in both EPSG:3857 (WGS84 Web Mercator) and EPSG:27700 (British National Grid). For more details on what products you can request directly from OS, you can check the Overview page.

  1. Open QGIS and from the Browser section right-click on the WMS/WMTS node and click New Connection.

    X0dGepm91d.png

     

  2. In the Create a New WMS/WMTS Connection panel:

    • Give the service a clear name such as OS Maps API base maps.

    • In the URL field enter the following URL https://api.os.uk/maps/raster/v1/wmts?key=your-API-key-goes-here and replace the your-API-key-goes-here placeholder with your alpha-numeric OS Data Hub Project API Key.

    • In the WMS/WMTS section set the:

      1. The WMS DPI-Mode to off.

      2. The WMTS server-side tile pixel ratio to Standard (96 DPI).

        qgis-bin_WiABXgoDYc.png

         

    • Click OK.

    • Now you are ready to use the base maps.

      Photos_sEvKrFby2e.png

       

Add OS Maps API WMTS service via Astun Data Services

As described in the Overview page, ADS provides you with enhanced styles of the OS Maps API styles in WMTS. Those are: Leisure style with additional zoom-levels down to large-scales, Dedicated Leisure 25k and 50k styles, Grayscale versions of Road, Outdoor, Light and Leisure.

  1. Open QGIS and from the Browser section right-click on the WMS/WMTS node and click New Connection:

    X0dGepm91d.png

     

  2. In the Create a New WMS/WMTS Connection panel:

    1. Give the service a clear name such as OS Maps API WMTS base maps via ADS.

    2. In the URL field enter the following URL https://map.services.astuntechnology.com/your-organisation-goes-here/osmaps/service?REQUEST=GetCapabilities&SERVICE=WMTS&key=your-API-key-goes-here and replace the API key and the organisation placeholders with your API key and your organisation name. If you are unsure of your organisation name, please contact us via support.

    3. In the WMS/WMTS section set the:

      1. The WMS DPI-Mode to off.

      2. The WMTS server-side tile pixel ratio to Standard (96 DPI).

        qgis-bin_cJVDP5aqn0.png
    4. Click OK.

    5. Now you are ready to use the base maps.

      qgis-bin_XWAnSxZJN2.png

       

Enabling the Tile Scale panel

With the Tile Scale enabled, you can lock the zoom to the appropriate tile scale provided by the WMTS service. To do that:

  1. Open the View tab, select Panels and enable Tile Scale :

    Photos_8Re0JUyULX.png

Printing

WMTS

To print the same scale of base mapping that is shown in the map canvas the Export resolution of the layout must be set to 96 dpi which matches the native resolution of the WMTS tiles. Choosing another Export resolution such as 192 dpi may result in a crisper base map but runs the risk of the print base map displaying a different style. When a Map is added to the Layout the Set Map Scale to Match Main Canvas Scale button (accessible when you have selected the Map Item via the Item Properties tab) can be used to ensure the map canvas and print map have the same scale and hence are displaying the same style of base map.

  1. Click the New Print Layout button and give a name to the layout:

    Photos_BtTPP81YZj.png

  2. Select the Add Map button and draw your map:

    Photos_QnYU7bFUQs.png

  3. On the Layout Panel Find the Export Settings section and reduce the dpi from the default 300 to 96:

    qgis-bin_AnGjaSunXa.png

     

  4. Right-click on the map item and select Item Properties:

    ZjVQXjatyp.png

     

  5. Navigate to the Item Properties panel and click the Set Map Scale to Match Main Canvas Scale:

    qgis-bin_0pw1zf9gba.png

     

  6. Continue with any additional styling you prefer for your layout and proceed to export your PDF:

    1. Map Canvas:

      qgis-bin_42WRdqqjuR.png

       

    2. Layout Preview:

      qgis-bin_OnwTNCzC6B.png

    3. Exported PDF:

      Acrobat_03FgIzzZ6k.jpg

Leisure style (WMTS)

Printing the Leisure style at 192 dpi commonly results in a different OS raster product. All raster products (MiniScale, 250k, 50k, and 25k) are displayed at two zoom levels, their native scale and half their native scale (zoomed out); this makes it possible to produce 192 dpi of a given product by zooming the map canvas to the half of their native scale, setting the layout scale to match the map canvas and setting the Export resolution to 192 dpi. The preview in the layout might display the wrong product but the PDF should show the same as the map canvas.

The 50k and 25k OS raster products are also available as individual base maps via Astun Data Services; these may help when creating a map that should show a specific base map.