4

I have a points from file in CSV format containing the following fields:

enter image description here

I want after ordering the points based on collecting time, to calculate the direction in degrees between the points. enter image description here

From point 1 to point 2, from point 2 to point 3, etc. How can I do that ?

1 Answer 1

6

As your items are already sorted by time, Id can be used as the ordering reference.

Go to your layer's Attributes Table and create a new Field with the Field Calculator, using this formula:

azimuth($geometry,geometry(get_feature(@layer_name,'Id',"Id"+1)))*180/pi()

It computes the azimuth (in degrees) between the current point (Id) and the point which has Id+1 in the layer.

enter image description here

You can then for instance use the Azimuth field to rotate arrows indicating the next point:

enter image description here

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.