2

We are using QField to track routes and collect data on certain parts of the route. The routes are not predetermined, we decide in the field which way to go. The tracking layer is a MultiLine-layer. Is it possible to show the distance travelled while tracking a route with the QField app?

I have tried adding a column called “distance” with $length as default value in the Attributes Form (and the "Apply default value on update" box checked), but I can only see the value in the Qfield app when clicking on the tracking line and then on the id, and I need to close this panel and re-open it again to see the updated value. I would prefer to be able to see the value get updated while we are moving, in other words a real-time value.

Any ideas?

1 Answer 1

2

I figured it out by myself:

I added two new columns to the tracking layer:

  1. Num_points and
  2. RT_Distance.

Num_points has a default value of num_points($geometry) (with 'Apply default value on update'box checked)

and the RT_Distance column has WidgetType Value Relation as explained on this site: https://docs.qfield.org/how-to/live-default-value/ with Num_points as the value column and a default value referring to the Distance-column "Distance", here also the 'Apply default value on update'box checked.

Furthermore I chose the Distance column as Display Name under layer properties-Display. This way I can click on the line during tracking and I can see the real-time value of the Distance-column change while moving.

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.