I'm new to GIS.

I have some tracks of people walking from point A to point B that I took using breadcrumbing with Garmin e-trex (set on the Auto track settings). I've loaded the tracks into QGIS and would like to calculate distance travelled along each track (cumulative distance is most important, but distance from trackpoint to trackpoint could also be useful). However, in the Attributes Table I can see only coordinates data, not distance data.

Is there any easy way to calculate distances travelled along tracks in QGIS?

  • Can you show screenshot from map & data ? – Shiko Aug 18 '16 at 10:00
  • GIS is not great for this stuff, line objects can't have geometric substructure like tracks need. If you will do this a bit it is worth learning R or Python or similar which are more flexible and provide better reproducibility. – mdsumner Aug 18 '16 at 12:58

The reason why you do not see the length in the attribute table is that the length (and area) of features are implicit attributes of their geometries. They are not stored by default, they need to be calculated.

If by cumulative distance you mean the total length of the line, you can get that value by creating a new field in the Field Calculator using $length as expression. QGIS will then calculate the length from the geometry and store it as attribute value.

For anything else you would need to first split up each line into its segments. For that use the "Explode Lines" function from the Processing Toolbox. You will get a new feature for each line segment. Then you can calculate the length per segment as shown above.

  • Thanks, could you explain more " you can get that value by creating a new field in the Field Calculator using $length as expression. " - I'm not sure what the Field Calculator is, I haven't used it before? Total length of the line is indeed what I'm after. – Georgia Aug 18 '16 at 11:54
  • Not sure why they posted that part of the answer as separate answer but @Knightshound has screenshots in their post. – bugmenot123 Aug 19 '16 at 10:09

Field Calculator is the abacus icon. Select the layer you want and open the field calculator.

enter image description here

Insert details for new field and write the expression $length and click 'ok'. A new column has been created for that layer with the calculated length of each feature

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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