In an attemp to add another set of x,y coordinate to QField (mark the start and the end of a line feature with points) I have created another set of "lat" "long" fields linked to a checkbox as indicated here :QGIS 3.16 Use change state of a checkbox as a trigger for updating another field

Unfortunately the formula in the field : if("State=end", $x, 'NULL') didn't add a new coordinate, the one of my position after moving from the start (or the position of the cursor distant to the start) but instead the same value as the entity location.

To resume, at my sense, QField don't allow to create line informations based on an entity with 2 locations. But is there a way? Maybe $x is not the command I should request, @position_coordinate is not working neither. Should I ask a request to the creator of this fantastic app to emplement it?

1 Answer 1


For a line type layer, with ESPG:4326, you can use:

replace(geom_to_wkt(start_point($geometry),5),map('Point (','',' ',',',')','')) replace(geom_to_wkt(end_point($geometry),5),map('Point (','',' ',',',')',''))

Of course, it can be adapted to other coordinate systems.

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.