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

The instructions that follow demonstrate how to connect to OS NGD API – Features using QGIS; you can either follow the YouTube video or the written step-by-step instructions with screenshots.

## What you need

* QGIS (version 3.12.0 or later).
* A preloaded basemap, for example, [OS Maps API](/os-apis/accessing-os-apis/os-maps-api.md) or [OS Vector Tile API](/os-apis/accessing-os-apis/os-vector-tile-api.md).
* OS NGD API – Features added to an API project in the OS Data Hub with an API Key. See [Getting started with an API project](/os-apis/core-concepts/getting-started-with-an-api-project.md) for more information.

## Instructions

### :new: Video tutorial

{% embed url="<https://www.youtube.com/watch?v=JojWnP_wpwg>" %}
YouTube video showing how to connect to OS NGD API – Features using QGIS.
{% endembed %}

{% hint style="info" %}

### Connecting to OS NGD API – Features

If you are connecting to OS NGD API – Features for the first time, then you can follow **either step 2 or step 3** below to set up a new connection via QGIS. **It is not necessary to follow both steps.**
{% endhint %}

{% stepper %}
{% step %}

### Set up a new connection

Once a new project with a base map has been set up, zoom in to a small area to reduce the number of requests that are initially sent to the API. Select `Layer > Add Layer > Add WFS / OGC API - Features Layer`.

<figure><img src="/files/13666eebd36eb05defb7e4a4e6908b3bd1133e56" alt="The Layer menu open to the Add layer sub-meny and Ad WFS / OGC API - Features Layer highlighted in QGIS"><figcaption><p>QGIS Add WFS / OGC API - Features Layer option.</p></figcaption></figure>
{% endstep %}

{% step %}

### Create a new connection in the WFS Connection dialog

In the Data Source Manager | WFS / OGC API - Features dialog click **New** and in the New WFS Connection dialog:

* **Name**: Provide a name for the connection.\
  \&#xNAN;*You can reuse this connection in the future.*
* **URL**: Copy the OS NGD API – Features endpoint address from the OS Data Hub and paste it into this field.\
  \&#xNAN;*Your API Key is automatically appended to this URL in the* `key` *parameter.*
* **Authentication**: Leave these settings at their defaults.\
  \&#xNAN;*You do not need a username or password as authentication is done through your API Key.*
* **Version**: Click *Detect* to identify the version.
* **Enable feature paging**: Select this option, if necessary.
* **Page size**: Enter a maximum page size.\
  \&#xNAN;*This limits the page size to a maximum number of features. We recommend a setting of about* `100` *to speed up response times. Larger values may result in a very slow response time.*
* **Other**: Leave the other settings at their defaults.
* Click *OK*.

![QGIS Create a New WFS Connection dialog.](/files/7e895d7ba0aaa1c041bd0a23279ec393aceb7d5e)
{% endstep %}

{% step %}

### Create a new connection using a saved server configuration

The Ordnance Survey GitHub repository contains API resources and configuration files that can be loaded directly into the QGIS Data Source Manager following the [Connecting to web services guide in the QGIS documentation](https://docs.qgis.org/3.40/en/docs/user_manual/managing_data_source/opening_data.html#connecting-to-web-services).

{% embed url="<https://github.com/OrdnanceSurvey/osngd-resources/tree/main/api-resources>" %}
Access the OS NGD API resources on GitHub.
{% endembed %}
{% endstep %}

{% step %}

### Adding layers to the map

In the Data Source Manager | WFS / OGC API - Features dialog:

* Select your new connection in the dropdown, if necessary.
* Click *Connect*.

![QGIS Data Source Manager | WFS > Server Connections.](/files/7b37fd7779c74654dd55d3105662e6bd03acbdf1)

When you click Connect, a list of layers available in OS NGD API – Features populates in the main box:

* **To add a layer to the map**: Select the layer to highlight it. You can select multiple layers by using the Ctrl key.

{% hint style="info" %}
As best practice, only load layers that relate to your current task – not all layers. The more features you call, the longer it takes to load them into QGIS. In addition, each feature, regardless of its layer, counts towards your [rate limits](https://docs.os.uk/os-apis/core-concepts/rate-limiting-policy).
{% endhint %}

* **Only request features overlapping the view extent**: Select this option.
* Click *Add.*

![QGIS Data Source Manager | WFS / OGC API - Features.](/files/85aeb5e2ae90bc85e7d4816430f9753f9c0dbdd4)

*The layer will then display in the Layers panel and the data will display on the map:*

![QGIS UI showing OS NGD API – Features data in the Layers panel and map area.](/files/67d5c43a9703a7c0365323afc53ff3eb268886be)
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.os.uk/os-apis/accessing-os-apis/os-ngd-api-features/getting-started/gis-software/qgis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
