Difference between revisions of "QGIS Extract Ground Elevation"

From Tuflow
Jump to navigation Jump to search
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
=Introduction=
 
=Introduction=
 
This page describes the method for extracting ground elevation (or any other variable) from raster files or polygon attribute using "Point Sampling Tool". This method is useful when you want to:
 
This page describes the method for extracting ground elevation (or any other variable) from raster files or polygon attribute using "Point Sampling Tool". This method is useful when you want to:
* Extract ground elevation for the points snapped to breaklines
+
* Extract ground elevation at points snapped to breaklines
* Define ground elevation for 1D nodes/pits snapped to 1D channel/pipes
+
* Define ground elevation at 1D nodes/pits snapped to 1D channel/pipes
 
* etc...
 
* etc...
In the example below, the ground elevation for the 2d_zsh point layer in the [[Tutorial_Module03 | TUFLOW Tutorial 03]] is extracted from the DEM file.
+
In the example below, the "Z" attribute (ground elevation) of the 2d_zsh point layer in the [[Tutorial_M11 | TUFLOW Tutorial 11]] is extracted from DEM file.
  
 
=Method=
 
=Method=
 
<ol>
 
<ol>
<li>Ensure that the plugin has been loaded and that the line file is open.</li>
+
<li>Ensure that DEM and 2d_zsh line layer files are opened, and the Point Sampling Tool plugin has been installed (Plugins >> Manage and Install Plugins >> Point Sampling Tool) </li>
<li>From the menu select ''Plugins >> mmqgis >> Modify >> Convert Geometry Type''.</li>
+
<li>Convert line vertices to points, using the preferred method described in the [[QGIS_Convert_Lines_to_Points | QGIS Convert Lines to Points]] page</li>
[[File:QGIS Lines to Points.jpg|500px]]
+
<li>Open the Point Sampling Tool</li>
 +
[[File:QGIS Extract Ground Elevation 001.png|700px]]
 
<li>Set the following:<br>
 
<li>Set the following:<br>
* The source layer to be the line file you wish to convert
+
* Select the point layer converted at step 2 as the "Layer containing sampling points"
* The new geometry type to '''Nodes'''
+
* Select all the attribute in the point layer as well as the DEM as the "Layers to get value from"
* The output file
+
* Set the output layer file name
The plugin will create a new point file which contains all vertices along the line. If you wish to create intermediate points along the line you will need to use an alternate plugin.  A plugin called ''Profile from Line'' appears to do this.
+
The plugin will create a new point layer file which contains all attributes in a 2d_zsh layer and the bed elevation as the 5th attribute.
 +
<li>Open the Attribute Table of the newly created layar. Toggle editing and update "Z" attribute with "dem_m01" as shown in the image below</li>
 +
[[File:QGIS Extract Ground Elevation 002.png|600px]]<br>
 +
This point layer is now ready to be input with the 2d_zsh line layer into the TUFLOW model.
 
</ol>
 
</ol>

Latest revision as of 15:26, 6 January 2023

Introduction

This page describes the method for extracting ground elevation (or any other variable) from raster files or polygon attribute using "Point Sampling Tool". This method is useful when you want to:

  • Extract ground elevation at points snapped to breaklines
  • Define ground elevation at 1D nodes/pits snapped to 1D channel/pipes
  • etc...

In the example below, the "Z" attribute (ground elevation) of the 2d_zsh point layer in the TUFLOW Tutorial 11 is extracted from DEM file.

Method

  1. Ensure that DEM and 2d_zsh line layer files are opened, and the Point Sampling Tool plugin has been installed (Plugins >> Manage and Install Plugins >> Point Sampling Tool)
  2. Convert line vertices to points, using the preferred method described in the QGIS Convert Lines to Points page
  3. Open the Point Sampling Tool
  4. QGIS Extract Ground Elevation 001.png
  5. Set the following:
    • Select the point layer converted at step 2 as the "Layer containing sampling points"
    • Select all the attribute in the point layer as well as the DEM as the "Layers to get value from"
    • Set the output layer file name
    The plugin will create a new point layer file which contains all attributes in a 2d_zsh layer and the bed elevation as the 5th attribute.
  6. Open the Attribute Table of the newly created layar. Toggle editing and update "Z" attribute with "dem_m01" as shown in the image below
  7. QGIS Extract Ground Elevation 002.png
    This point layer is now ready to be input with the 2d_zsh line layer into the TUFLOW model.