

For this example, we will create three different contour line widths. Edith line width with and expression.Īfter you click ‘Edit’ a new dialog will appear where you can enter an expression to set line widths. For example, contours divisible by 100 can be made thicker than the other contour lines. This will allow us to give different line widths to different contour intervals. We’ll use an expression to specify the variable line widths.Ĭlick on the options button and select ‘Edit’ (see image below) to edit contour line width with an expression. The widest lines will be divisible by 200, the next widest will be divisible by 100, and all other contour lines will be the default value. In this example, we will create different widths for contour lines. For example, contour lines that are divisible by 200 ft would be thicker than other contour lines.

With contour lines, it is common to make lines at larger intervals wider than lines at narrow intervals. If this panel is not open in QGIS by default you can open it from the Main Menu with View > Panels > Layer Styling. We will conduct all of the contour line styling using the Layer Styling panel. The image below shows the generated contour lines overlaid on the pseudocolor DEM. Once you’ve specified parameters for the Contour tool, click Run and the contours will be generated. For this example, I’m exporting the contour in a GeoPackage format. Contours: the output contour file to be generated.For example, if you specified contours be spaced every 100 m and set the ‘offset from zero’ to be 50 m then contours would be placed at elevations of 150 m, 250 m, 350 m, etc. Offset from zero: if you want intervals to start at an elevation different than zero.Attribute name: the name of the attribute table column where the elevation of each contour line is recorded.

Interval between contour lines: the vertical distance between contour lines (this will be in the vertical units of your DEM), I’ve specified the contour lines to be spaced 20 meters apart.Band number: the band number of the input raster to use when generating contours.You can either select a layer from the drop-down or select a file from your system. Input layer: the input DEM to generate contours from.You will most likely only adjust one or two parameters, but I’ve included a description for each of the parameters to help you understand their meaning. Selecting the Contour tool will open a new window where you will specify the parameters that generate contours (see image below). In QGIS, contour lines can be easily created using the ‘Contour’ tool, which can be accessed on the QGIS Main Menu from Raster > Extraction > Contour. The DEM I am using has vertical units of meters. It’s important to know the vertical units for your DEM. If you’re new to QGIS, you learn the basics in this tutorial to get up to speed. The images below display a portion of the DEM I am using. Also, members of my QGIS course have access to a DEM in the course data.
CONTOUR LINE DOWNLOAD
You can follow this tutorial to download a similar DEM. I’m using a high-resolution lidar DEM from the USGS. To start, you’ll need to add a DEM to QGIS. This tutorial uses a digital elevation model (or DEM) to generate topographic contours. I will also introduce some advanced concepts that will help you automatically label or style features based on attribute table values.
CONTOUR LINE HOW TO
This tutorial will demonstrate the basics of how to create, style, and label contour lines in QGIS. Creating, styling, and labeling contour lines can be a little tedious, and it takes a little bit of time to learn exactly which tools to use to do this in QGIS. However, they can represent spatially changing values for any variable. Contour lines are most often used to represent topography on two-dimensional maps and figures.
