Skip to content

All about data

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”
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 plugin 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

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

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 diffirent kinds of data or how to connect to different services in QGIS.

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

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.

Contact us or sign-up to our courses if you are interested in having this as an instructor-led or self-paced course.