Skip to content
Learn QGIS with BNHR

Module 2 · Intermediate

All about data

This module discusses tips, tricks, caveats, and gotchas when working with geospatial data in QGIS.

Module 2Level Intermediate
On this page
  1. Overview
  2. Introduction
  3. What you should already know
  4. Where to find free and open geospatial data
  5. Plugins that help you access/download data directly in QGIS
  6. QuickOSM plugin
  7. OpenTopography DEM Downloader plugin
  8. STAC API Browser
  9. External sources, data portals, etc.
  10. Not all data are created equal
  11. The fault in our administrative boundary data
  12. The propagation of errors
  13. Certification and support

This module discusses tips, tricks, caveats, and gotchas when working with geospatial data in QGIS.

As a foundational module, no previous knowledge of GIS or QGIS is required. However, familiarity with the QGIS interface as discussed in QGIS: Essentials - Introduction to QGIS, how to load different kinds of layers as discussed in QGIS: Essentials - Introduction to layers in QGIS, and how to run processing algorithms as discussed in QGIS: Essentials - Basic geospatial processing techniques are preferred.

Where to find free and open geospatial data

Section titled “Where to find free and open geospatial data”
  1. Learn where you can find free and open geospatial datasets

The video below is in Filipino

Plugins that help you access/download data directly in QGIS

Section titled “Plugins that help you access/download data directly in QGIS”

Some of the most common and useful QGIS plugins are those that allow you to directly download data in QGIS. Some of these plugins include:

The QuickOSM plugin allows you to “download OSM data thanks to the Overpass API. You can also open local OSM or PBF files. A special parser, on top of OGR, is used to let you see all OSM keys available.”

The QuickOSM plugin
Installing the QuickOSM plugin

Once installed and activated, the plugin can be run from the main menu under Vector ▸ QuickOSM ▸ QuickOSM

How to run QuickOSM plugin
Running the QuickOSM plugin

This will open the QuickOSM window. The easiest way to download data using QuickOSM is via the Quick Query tab and providing:

  • Key
  • Value
  • Extent
  • Other Advanced Parameters

For example, if we want to download all linear vector data for roads (key on OSM is highway) within Barangay UP Campus, we can provide the following parameters:

  • Key: highway
  • Value: blank (means all values)
  • Extent: Layer Extent (adm_UP_Campus or whatever layer we want to use)
  • Advanced:
    • check Lines, Multilinestrings
Example QuickOSM plugin 01
Parameters for the QuickOSM plugin

After we click Run Query, the plugin will try to load all data from OSM that meet the criteria we set.

Example QuickOSM plugin 02
QuickOSM query completed

You will see that a highway layer is loaded after running the query in QuickOSM.

Output QuickOSM plugin
Layer from QuickOSM loaded in QGIS

As with most default outputs in QGIS, the layers loaded using QuickOSM are temporary layers.

You can load any and all layers on OpenStreetMap via the QuickOSM plugin. You are only limited by the capability of your computer and/or internet connection.

This means that you can use QuickOSM to load points of interests like schools, hospitals, government offices as well as other data such as rivers, lakes, and even building footprints.

There are other ways to use QuickOSM to load data in QGIS. To learn more, you can read its documentation or watch below:

The OpenTopography DEM Downloader will “download DEMs from OpenTopography.org for user selected extent only.”

The OpenTopography DEM Downloader plugin
Installing the OpenTopography DEM Downloader plugin

Once installed and activated, the plugin can be run from the main menu under Raster ▸ Open Topography DEM ▸ OpenTopography DEM Downloader

How to run OpenTopography DEM Downloader plugin
Running the OpenTopography DEM Downloader plugin

To use the OpenTopography DEM Downloader plugin, you will need to sign up for an OpenTopography account and request for an API key.

This will open the OpenTopography DEM Downloader window where you can specify the:

  • DEM you want to download
  • Extent you want to download
  • API key
  • Output raster
Example OpenTopography DEM Downloader plugin
Parameters for the OpenTopography DEM Downloader plugin

For example, if we want to download an SRTM 30m DEM covering the extent of the National Capital Region, we will provide the following parameters:

  • DEM: SRTM 30m
  • Define extent to download: Calculate from Layer > adm_NCR (or whatever layer we want to use)
  • Enter your API key or use existing one below: the API key you generated with your OpenTopography account
Example OpenTopography DEM Downloader plugin
Sample for downloading an SRTM 30m DEM covering the National Capital Region using the OpenTopography DEM Downloader plugin

You will see that an SRTMGL1[memory] raster layer is loaded after successfully running the OpenTopography DEM Downloader plugin.

Example OpenTopography DEM Downloader plugin
SRTM 30m DEM from the OpenTopography DEM Downloader plugin loaded in QGIS

You can use this layer as you would any raster layer in QGIS but take note that it is still a temporary layer so you need to save it in order to make it persistent.

The STAC API Browser plugin “adds functionality to search, load and manage STAC API resources inside QGIS.”

STAC or the SpatioTemporal Asset Catalog is a family of specifications designed to help standardize the way collections of geospatial (and temporal) data are exposed, structured, and queried. In other words, it makes it easy to catalog, search, and load geospatial data.

The STAC API Browser plugin
Installing the STAC API Browser plugin

Once installed and activated, the plugin can be run from the main menu under Plugins ▸ STAC API Browser Plugin ▸ Open STAC API Browser.

Running the STAC API Browser plugin

This will open the STAC API Browser window where you can search for data given the following parameters:

  • Connections: the STAC API to use
  • Collections: the STAC collections available in the Connection
  • Filters: ability to filter the collections/data to search
    • Date
    • Extent
    • Other advanced filters
Search tab (and parameters) of the STAC API Browser plugin

For example, if we want to search for Land Use/Land Cover-related data for NCR from the Microsoft Planetary Computer STAC API, we may want to use the following parameters:

  • Connections: Microsoft Planetary Computer STAC API
  • Collections:
    • 10m Annual Land Use Land Cover (9-class) V2
    • ESA Land Cover
    • ESA WorldCover
    • ESA Climate Change Land Cover Maps (Cloud Optimized GeoTIFF)
  • Extent:
    • Calculate from Layer (adm_NCR or any layer we want to use)
Parameters for searching some Land-Use and Land-Cover-related collections covering NCR

Clicking Search will search for data in the selected collections that include our provided extent (NCR).

STAC API Browser plugin searching for assets

Once the Search is completed, we can find all the available data in the Results tab.

STAC API Browser plugin search results

To load the data in QGIS, click on View Assets to open the Assets window. Check Select to add as layer then click Add selected assets as layers.

Adding assets to QGIS using the STAC API Browser plugin

The selected asset will then be loaded in QGIS.

Selected asset from the STAC API Browser plugin loaded in QGIS

To learn more about the plugin, visit its documentation

There exists countless data sources online where you can find and download geospatial data—from data portals, web services, APIs, and websites hosting data. Some examples are:

To work with these data sources in QGIS, it is imperative that you know how to load different kinds of data or how to connect to different services in QGIS.

Just because two datasets cover the same area or extent, doesn’t mean they can be used together.

The fault in our administrative boundary data

Section titled “The fault in our administrative boundary data”

Administrative boundary data is a core dataset frequently used in any mapping or GIS activity. In the Philippines, they typically come from two common sources:

If you look at the barangay boundary data of the layers from these two sources, you will notice that they are not equal and, in fact, there are significant differences in the shapes and areas of the barangays. This is important because these differences will reflect in the mapping and GIS activities done using these datasets.

GADM (blue) and HDX (red) barangay-level administrative boundary layers
Zoomed in view of GADM (blue) and HDX (red) barangay-level administrative boundary layers. Notice the differences.

Due to the political nature of administrative boundaries, they should always be handled and presented with care. Many maps include a disclaimer indicating that the shown administrative boundaries are indicative.

Other data that rely on administrative boundaries (e.g. to clip or subdivide the data) must make a choice as to what admin boundary data to use and—as mentioned above—this choice affects the final dataset.

For example, if you look at Meta’s High Resolution Population Density Maps, it becomes clear that they used GADM.

GADM barangay boundaries align perfectly with Meta’s High Resolution Population Density layer
Zoomed in to show that GADM barangay boundaries align perfectly with Meta’s High Resolution Population Density layer
HDX (UN OCHA/PSA/NAMRIA) barangay boundaries do not align with Meta’s High Resolution Population Density layer
Zoomed in to show that HDX (UN OCHA/PSA/NAMRIA) barangay boundaries do not align with Meta’s High Resolution Population Density layer

On the other hand, if you look at Project NOAH/UP Resilience Institute’s Flood Hazard data, you will notice that the flood layer was clipped using the HDX UN OCHA/PSA/NAMRIA layer.

UPRI flood hazard layer with GADM NCR admin boundary. Notice that the boundaries of the flood hazard and admin boundaries do not align.
Zoomed in view of the top area where the misalignment of the flood hazard and GADM admin boundaries are very noticeable.
UPRI flood hazard layer with HDX (UN OCHA/PSA/NAMRIA) NCR admin boundary. Notice that the boundaries of the flood hazard and admin boundaries align perfectly.
Zoomed in view of the same top area that shows perfect alignment between the flood hazard layer and the HDX (UN OCHA/PSA/NAMRIA) NCR admin boundary.

And then there are those that do not conform to any of the two common admin boundary data. For example: if you look at the Ground Shaking Hazard from PHIVOLCS, it does not align perfectly with either the GADM or the HDX (UN OCHA/PSA/NAMRIA) NCR admin boundary.

PHIVOLCS Ground Shaking hazard layer with GADM NCR admin boundary. Notice that the boundaries do not align perfectly.
PHIVOLCS Ground Shaking hazard layer with HDX (UN OCHA/PSA/NAMRIA) NCR admin boundary. Notice that the boundaries do not align perfectly.
Zoomed in view of PHIVOLCS Ground Shaking hazard layer with GADM NCR admin boundary. Notice that the boundaries do not align perfectly.
Zoomed in view of PHIVOLCS Ground Shaking hazard layer with HDX (UN OCHA/PSA/NAMRIA) NCR admin boundary. Notice that the boundaries do not align perfectly.

It’s crucial to remember that datasets covering the same geographic area aren’t always compatible. Recognizing this helps us avoid preventable errors and encourages thorough data verification.

Saved in this browser only

Certification and support

We offer additional resources, certificates, official QGIS certification, ongoing support, and other perks to those who join our instructor-led training.

Join an upcoming training to take this as an instructor-led course, or contact us to arrange one for your team or organization.

Something new

Identify results
LayerTry an exercise
ExerciseCreating new fields using the Field Calculator
Number1.3, in Working with attributes
CourseQGIS: Layers and Expressions
DataProvided in the lesson