Here’s a 5-chapter tutorial on the new QGis feature in version 3.26: elevation profiles.
Chapter 1: Profiles from vector layers
Chapter 2: Profiles from raster layers
Chapter 3: Profiles from point clouds (Lidar)
Chapter 4: Profiles layout
Chapter 5: Profiles in QField
Chapter 1:
The elevation profile panel
The data required for this tutorial is available here.
We’ll start this tutorial by getting to grips with the “Elevation profile” panel. To display it, go to the menu View->Elevation profile
This panel is in turn divided into two panels: layers and profiles. There’s also a toolbar.
You end up with two layer panels: the project layer and the profile layer. You cannot load layers into profile layers if they are not in the project layer panel. This apparent duplication is explained by the fact that, with the project layer, you control the layer’s appearance in the map window, while with the profile layer you control its profile parameters.
First concept: what is a profile?
A profile is the result of intersecting a polyline with a layer of terrain heights, and then displaying the XYZ cross-section of the terrain as a profile.
From this definition we can draw the first rule of use: at least two classes of entity are required for a profile to be built: a layer with terrain heights (raster, vector, point cloud, etc.) and a polyline entity that defines the profile to be built. This entity can be built freehand, in the map window, using the Capture Curve tool.
Or it can be selected by capturing it from an existing polyline layer, using the Capture curve tool
Second notion: profile layer geometry types
Layers in the profile layer panel can be of two types:
- 2D geometries, i.e. with X and Y values (MultiLineString, Polygon,…)
- 3D geometries, i.e. with X, Y and Z values (MultiLineStringZ, PolygonZ, etc.).
A third case may arise when a layer has an XYZ definition and Z values are not specified. In this case, it behaves like a 2D (XY) layer.
2D layers
If you load a 2D layer
If we draw a profile line, the result will be as follows
The extension is unable to find the height values. To overcome this problem, we need to indicate where the Z values are.
In the case of this layer, they are located in the ALTITUDE field of the attribute table.
To perform this operation, open the properties menu in the layer panel of the profile
In the Properties window, we will always work in the ELEVATION tab.
To take the ALTITUDE attribute into account, we open the Value defined by the data in the Offset field and point to the ALTITUDE field.
The result is a height profile:
3D layers
If you load a layer of type Z,
We don’t need to do anything. When we draw the polyline, we obtain the profile directly
Modify profile symbology
When you move the cursor over the profile line, you’ll notice that a cursor also moves over the polyline in the map window. If you ask for information on a profile point, the corresponding contour line will be highlighted, in addition to the profile information.
The two windows are dynamically linked. This also applies to symbology. The color of the profile points results from the color of the lines in the map window. If we change the contour line colors, we’ll see the same changes in the profile points.
But there are also some profile-specific formatting options.
You can display a continuous line instead of profile points: Properties-> Elevation, then Interpretation -> Continuous surface.
Or you can have a full profile: STYLE-> Fill in below
The result is