For a project I'm working on I need to do a triangulation over points (csv) or lines (dxf). When running the TIN interpolation from the processing toolbox I save the triangulation as a temp file.

This polygon output has no z-value in its geometry.

screenshot db-manager

With drape, I can get the z-value from the raster-output from the TIN interpolation, but not all points are on the raster so there are lines that have the default value.


Is there a way to fix this, or add the z-value to the geometry from the input source?

  • Hello, I didn't understand in wich source you have z-value : is it your points ? In the second img we see line partly outside of your region with raster heigth data. Can you get height data in a larger region ? Commented Apr 18, 2021 at 10:41
  • Hello, The z value is in the points or lines that are used as input for the tin-interpolation. There are 2 outputs, a raster file and a triangulation polygon file. the raster has z-values, but the polygons don't. With drape i wanted to get the z from the raster, but as shown on the last picture of my post there are some points in the polygons that are outside of the raster.
    – Lars81
    Commented Apr 18, 2021 at 11:19

1 Answer 1


You have points with z values and also lines that have z value (based on the points as vertices). You want lines with z values but with more vertices more points with z data.

First solution : the algorithm densifygeometries in the toolbox on your line layer source that have Z-value. It would make new vertices on each line and interpolate linearly the z-value. If you are using TIN with non-linear interpolation then it would not produce the result you want.

Other solution : you can add fake points in a larger area with the same value of the nearest point with data (manually or with algorithm). This would permit to produce a raster larger that would have value for all your line.

One way to do it with QGIS toolbox :

  1. Add z value in the field : use fiedl calculator to create a field z_value for all your source points (the formula should be z ($geometry)).
  2. Use tool minimum bounding geometry with your point layer as source and select convex hull as type of geometry produced. It will define a polygon around your point layer
  3. Use buffer to enlarge this polygon (define the value that will enlarge 25 % at least)
  4. Use tool : extract vertices
  5. Use tool : join by nearest. Your vertices as entry layer and your source points as layer to join.

result of your process

4bis. On the layer produced use the tool Set z value with the field z

enter image description here

  1. Merge your two layers.
  2. Use TIN tool based on the new layer.

Normally it should be fine then : )

  • Your first solution isn't going to work for my problem,The polygons must be made up out of 3 vertices. When I add more vertices to the polygons, the 'end software' doesn't recognize it as a dtm. As for you second solution. Can you give some pointers on which algorithms might do the trick?
    – Lars81
    Commented Apr 19, 2021 at 20:15
  • I did add the process to do it with qgis. If you have small dataset do it manually is a good option also. Commented Apr 20, 2021 at 9:39
  • Does-it work for your problem. You can mark as solution if it does and if it does not i could adapt it. Commented Apr 29, 2021 at 22:41
  • Hello. I just tried it. All the buffer functions I've tried only have xy dimensions. So when I use that in this process the interpolated z value will be lower than it actually is.
    – Lars81
    Commented Apr 30, 2021 at 5:47
  • Hello, I have add step 0 and 4 bis to make this work... i forget to mention it. Commented Apr 30, 2021 at 11:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.