Calculating daily travel distance from large dataset using QGIS?
Sounds like a use case for Trajectools - Day trajectories from point layer. It creates lines from timestamped points, e.g. here is an example of three days of ship movement:
Computing the length per line can then be done as described by Gabriel.
While the tool should be easy to use, the installation is a bit involved on Windows since the plugin requires GeoPandas but there's a step-by-step guide.
- First, you need a field populated with the day, to later group the waypoints by day.
In your case, you can create a new string type field and populate it in the field calculator with the expression:
substr( "name", 6, 7)
It will extract a substring of the "name" field, starting in the 6th character, and with a length of 7 characters (i.e., 21APR16). If you need to group by name and day, you can extract the substr( "name", 1, 12)
to obtain unique values for each name and day (i.e., 0940 21APR16).
- Then, you need to convert the waypoints to paths, grouped by the day field, sorted by the timestamp. Use the Points to path tool.
The output is a new Paths layer, with lines connecting the waypoints for each day.
- Finally, you can create a new decimal number (real) type field in that layer, and populate it in the field calculator with the following expression:
length( $geometry)
That expression returns the planimetric length of each feature of the layer. Use it with a projected layer. If you have all your data in geographic coordinates, you can define the ellipsoid in the CRS Project Properties and use the $length
expression instead, to return the ellipsoidal length.