Beyond 2D and static maps
Introduction
Section titled “Introduction”QGIS is powerful data visualization engine not just for conventional maps but also for other data types and visualizations. For example, QGIS has native support and plugins that handle 3D visualizations, point clouds, mesh datasets, and temporal data.
In this module, we will go over some of these capabilities.
What you should already know
Section titled “What you should already know”As an intermediate level workbook, you are expected to already know basic GIS concepts such as spatial data models and formats and QGIS functions such as loading and styling layers, running processing algorithms, saving QGIS projects, etc.
Visualizing in 3D
Section titled “Visualizing in 3D”There are several ways to visualize data in 3D using QGIS. In QGIS 3.0, 3D native rendering support was introduced in QGIS using 3D map views. Prior to this, developers and users relied on third party tools and plugins such as qgis2threejs.
Exercise 4.1.1. QGIS 3D Map View
Section titled “Exercise 4.1.1. QGIS 3D Map View”The native 3D support in QGIS allows you to render rasters, vectors, and mesh layers. It also provides you with methods for visualizing data in 3D depending on data type. For example, you can render points, extrude polygons, use DEMs as terrain, and even load external 3D models.
To access and manage 3D views in QGIS, go to View > 3D Map Views.
In this exercise, we will visualize the the province of Albay in 3D using a DEM and extrude buildings from OpenStreetMap.
- Load the osm_buildings, albay_srtm_32651, and satellite imagery of your choice.
Opening a new 3D map view
- Open a new 3D Map View in View > 3D Map Views > New 3D Map View. Add this map view to the QGIS interface.
- You can edit or rename this new Map View in the same menu.
- Notice that the 3D Map View is a bit bare. Next, you will edit its configuration to add the 3D information.
- To configure the 3D view, click on the configure (wrench) button in the map view toolbar.
Use a DEM as the terrain
- Instead of having a flat surface in your 3D view, you can specify a DEM to serve as the terrain. In this case, use the following parameters for Terrain:
- Type: DEM (Raster)
- Elevation: albay_srtm_326451
Apply 3D styles to a vector layer
- Next, you can also apply different styles for your vector layers in 3D. For example, we can add an extrusion to the osm_buildings layer. In this case, we will give all buildings the same extrusion value (20).
- Go to the 3D View tab of the Symbology or Layer Styling panel of the osm_buildings layer and add the following parameters:
- Your 3D view should look similar to the one below.
- Try to move around and navigate the 3D scenes.
Shadows, Eye Dome Lighting, and Ambient Occlusion
QGIS 3D views also have built in support for shadows, eye dome lighting, and ambient occlusion that can improve your 3D visualizations.
- To add these effects, go to the Configure tool and check the effect you want to activate.
Exercise 4.1.2. Qgis2threejs plugin
Section titled “Exercise 4.1.2. Qgis2threejs plugin”The three.js library is a popular, open source, JavaScript 3D library. Aside from general 3D work, you can use three.js to create 3D web maps. You can do this by writing code yourself or you can leverage QGIS to create your 3D maps with three.js using the Qgis2threejs plugin.
https://plugins.qgis.org/plugins/Qgis2threejs/
In this exercise, you will visualize the same data in the previous exercise but using the Qgis2threejs plugin.
- Load the osm_buildings, albay_srtm_32651, and satellite imagery of your choice.
- Run the Qgis2threejs plugin in Web > Qgis2threejs > Qgis2threejs Exporter
- Check the albay_srtm_32651 and osm_buildings. What happened?
Editing layer parameters
- You can edit layer parameters by Right-clicking on the layer > Properties… Edit the properties of osm_buildings so that it is extruded (has a height above the ground) by 20m. Use the parameters below.
- Zoom into the osm_buildings layer. Your preview should look similar to the one below.
Point clouds
Section titled “Point clouds”QGIS has both native support for visualizing and processing point clouds.
A point cloud is a three-dimensional representation of a space, comprised of numerous individual data points (as suggested by its name). Point clouds commonly include millions if not billions of points. Examples of point clouds are datasets obtained from drone/UAV surveys and photogrammetry.
Each point within the cloud possesses x, y, and z coordinates as well as additional attributes derived from the capture process, such as color values or intensity. These attributes enable functionalities like displaying point clouds in various colors. In QGIS, point clouds can be harnessed to create three-dimensional depictions of landscapes or other spatial environments.
QGIS offers support for two data formats: Entwine Point Tile (EPT) and LAS/LAZ. When dealing with point clouds, QGIS consistently saves data using the EPT format. EPT, a storage format, involves multiple files stored within a shared directory. EPT incorporates indexing for swift data access. For comprehensive insights into the EPT format, refer to the entwine homepage.
If the data exists in LAS or LAZ format, QGIS undertakes a conversion to EPT during the initial load. Depending on file size, this conversion process may consume some time. During this conversion, a subfolder adhering to the scheme “ept_ + name_LAS/LAZ_file” is generated within the folder containing the LAS/LAZ file. Should such a subfolder already exist, QGIS promptly loads the EPT, resulting in reduced loading times.
Exercise 4.2. Visualizing point clouds in QGIS
Section titled “Exercise 4.2. Visualizing point clouds in QGIS”In this exercise, you will load a point cloud of Plaza Roma, Philippines in QGIS and apply some basic styling.
- Load the the plaza_roma.copc layer.
- Create a new 3D map view.
- Apply some basic effects.
Mesh data
Section titled “Mesh data”QGIS also has native support for mesh data.
A mesh is an unstructured grid with spatial and often temporal components. The spatial part comprises vertices, edges, and faces, forming shapes in 2D or 3D space:
- Vertices: Represent XY(Z) points, following the layer’s coordinate reference system.
- Edges: Connect pairs of vertices.
- Faces: Consist of sets of edges forming closed shapes, typically triangles, quadrilaterals (quads), and occasionally polygons with more vertices.
Mesh layers can have varying structures based on these components:
- 1D Meshes: Composed of vertices and edges. Edges can carry data (scalars or vectors). Useful for modeling urban drainage systems.
- 2D Meshes: Comprise faces with triangles or unstructured quads.
- 3D Layered Meshes: Stacked 2D meshes extruded vertically (levels) with the same topology. Can change over time. Data is typically defined in volume centers or parametric functions.
QGIS employs the Mesh Data Abstraction Library (MDAL, https://www.mdal.xyz/) drivers to access mesh data and inherently supports multiple formats. MDAL provides a single data model for supported mesh data similar to what GDAL does for rasters and vectors. The available functions that you can do with mesh layers depends on the format and structure.
Exercise 4.3. Loading and visualizing mesh data
Section titled “Exercise 4.3. Loading and visualizing mesh data”In this exercise, you will load a mesh dataset of hurricane Michael in QGIS and apply some basic visualizations.
- Load the hurricane-michael-copernicus-ecmwf.nc file in QGIS. Select the mesh data (shown below).
- The layer you loaded should look similar to the one below.
- Notice that the layer has several groups that you can style (10 metre wind, 2 metre temperature, Total precipitation). These are information stored in the mesh data that we can show individually. Notice also that the 10 metre wind group has 2 icons to the right of it. The first pertains to Contours and the second pertains to Vectors. We can visualize and enable these to separately as well.
- Do the following:
- Enable Total Precipitation contour and the 10 metre wind vector. Go to the vector tab and apply the following parameters:
- Check Display on User Grid
- X Spacing: 20 px
- Y Spacing: 20 px
- Check Display on User Grid
- Enable Total Precipitation contour and the 10 metre wind vector. Go to the vector tab and apply the following parameters:
- Your map canvas should show both the total precipitation (as contours) and 10-meter wind (as vectors) like below.
Temporal visualization
Section titled “Temporal visualization”QGIS 3.14 introduced the Temporal Controller that provides native support for viewing temporal data in QGIS. Prior to this, the Time Manager plugin provided a similar functionality.
Using the Temporal Controller, you will be able to view and export “snapshopts” of data along specific time intervals. You can also combine them to create animations.
The Temporal Controller supports temporal information stored in different file formats such as rasters, meshes, and vectors.
To enable Temporal support, open a layer’s Properties and go to the Temporal tab. Depending on the kind of data it is, you will see different options for configuring temporal support. If successfully configured, you should see this icon () next to the layer.
Mesh data
Section titled “Mesh data”Exercise 4.4.1. Temporal visualization of mesh data
Section titled “Exercise 4.4.1. Temporal visualization of mesh data”The mesh data we loaded in the previous exercise actually contains information for about the hurricane at different times—e.g. hourly data from October 1-31, 2018. We can use this information to view the status of the hurricane over time.
- Edit the temporal configuration of the layer by opening its Properties > Temporal tab and apply the following settings.
- Next, we open the Temporal Controller Panel by clicking on the clock button (
) in the Map Navigation Toolbar.
- The Temporal Controller Panel has several functions that allow you to configure temporal navigation. To enable temporal navigation, click on the right-most button (with play button).
- Make sure that the Animation range values are correct—i.e. they correspond to the dates available in your data.
- The Step parameter defines how long each step/snapshot will be.
- If your animation is slow, you can also edit the framerate by clicking on the gear button on the upper right of the Temporal Controller Panel.
- With your animation properly configured, try to see how it looks like by playing the animation.
- Feel free to modify the parameters to suit your needs.
- You can also save the frames of the animation as a set of images that you can then use to create videos, GIFs, and other animations. To do this, click on the Save button in the Temporal Controller panel (next to the Step parameter).
Vector data
Section titled “Vector data”Exercise 4.4.2. Temporal visualization of vector data (mapping earthquakes)
Section titled “Exercise 4.4.2. Temporal visualization of vector data (mapping earthquakes)”You can also use the temporal controller for styling vectors. This is especially useful if you want to see not just where but when events occur. In this exercise, you will visualize earthquakes in the Philippines for the month of August 2023 from data gathered by PHIVOLCS.
- Load the earthquakes_ph_2023.08 data in QGIS.
- Check the attribute table/fields of this layer. Notice that it has fields for magnitude (mag), earthquake depth (depth_km), and the date + time of the earthquake (datetime).
- Style the layer such that the size indicates the magnitude (mag) and the color indicates the depth (depth_km). You can utilize a Graduated symbology with data-defined size.
- Open the Temporal tab in the layer’s Properties and check Dynamic Temporal Control. Edit the Configuration as Single Field with Date/Time, Limits as Include Start, Include End, Field is datetime, and Event duration is 1.00 Hours.
- Open the Temporal Controller Panel. Make sure that the Animation range is correct (e.g. between 2023-08-01 and 2023-08-28). For now, use 1.00 hours as the step but you can change it later. Play the temporal animation, what do you notice?
- What if you want to show the cumulative earthquakes over the course of the month? To do this, open the Temporal tab again and check Accumulate Feature over time
- Run the temporal animation again. Run the temporal animation again. What changed?
Certification and support
Section titled “Certification and support”Contact us or sign-up to our courses if you are interested in having this as an instructor-led or self-paced course.