0

I have a set of (original) points with a x, y and z value, imported from a text file. The points have a value field with an id that defines their order.

I can draw a line between them using the function "Points to path" from the original points.

I managed to generate points in a given distance on this line used the function "Points along geometry" to generate points in periodic distances. However, they don't have z-values (only x and y). I want to use the z-values of the original points to interpolate the z-values for the other points.

For clarification: Every point that was added afterwards on the line should get his z-value based on the interpolation from the point before and after him. The original points should keep their values.

How do I generate points with interpolated z-values from a few original points with z-values?

8
  • 1
    Do the points have an attribute value that defines their order, or can be used to determine the original points to interpolate between.
    – Oisin
    Commented Aug 10, 2023 at 10:52
  • @Oisin yes they have an id (as value) that defines the order. Commented Aug 10, 2023 at 11:14
  • Is the line you have generated symbology on the point layer, or part of a featureclass. Is it a single line through multiple points, or is each line between two 'original points'.
    – Oisin
    Commented Aug 10, 2023 at 12:04
  • How is this different from gis.stackexchange.com/questions/463791/… ? Commented Aug 10, 2023 at 12:26
  • 2
    How have you generated the new points? It's not clear to me the relationship between the original points, and the new points. Remember to edit the original question with answers to questions in the comments. (Comments are meant to be transient) Commented Aug 10, 2023 at 21:53

1 Answer 1

1

Using QGIS 3.30, and follow the steps above:

  1. Start with original points layer, with Z-values
  2. Convert to line using "Points to path"
  3. Interpolate new points using "Points along geometry"

The points layer from step 3 should have Z-values associated with it.

It also seems to work for QGIS 3.22 (the oldest version on my system), so not sure what is happening with your process.

enter image description here enter image description here

3
  • Seems like you are right, I missed this menu somehow. Thanks! Do you know, how to export the x, y and z values of all the interpolated points? Commented Aug 11, 2023 at 7:59
  • 1
    Not sure what you mean. If you save the layer as Geopackage, the data will all be exported. If you want to see it as attributes, use Field Calculator and $x/$y/$z. If you are asking something else, accept this answer and ask a new question. Commented Aug 11, 2023 at 8:05
  • It worked thaaaaaaaaaaaanks! QGIS nearly crashes, but hey it works Commented Aug 11, 2023 at 8:46

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.