Create a scratch layer (line).
Apply a label with this expression:
'dy = ' || to_string( y(start_point( $geometry))-y(end_point( $geometry))) || ' , dx = ' || to_string( x(start_point( $geometry))-x(end_point( $geometry)))
It will look like: dy = -0.7004608294930876 , dx = -0.9370199692780339
.
You can change the text as you want, eg if you want it to look like Change in Latitude = -0.7004608294930876 degrees, Change in Longitude = -0.9370199692780339 degrees
, use
'Change in Latitude = ' || to_string( y(start_point( $geometry))-y(end_point( $geometry))) || ' degrees' || ', Change in Longitude = ' || to_string( x(start_point( $geometry))-x(end_point( $geometry))) || ' degrees'
Use the round()
function if you want fewer decimal places.
Optional: if you want to see the coordinates of the start and end points, change to rule-based labeling and create two new rules:
First rule, label with this expression:
y(end_point( $geometry)) || ' , '|| x(end_point( $geometry))
Notice that the coordinate order; Y comes first because Y is latitude and X is longitude. If you wanted labels for easting and northing, reverse the order.
Data-defined placement for first rule: X = x(end_point( $geometry))
and Y = y(end_point( $geometry))
For the second rule, duplicate the first rule and substitute start_point
every place where end_point
was used.
When you want to measure the change in lat/long between two points, simply create a line feature between those two points. Because this is a scratch layer, any line features you create will be automatically deleted when you close the QGIS project. You can also clear them at any time by rolling back edits on the layer.
If you want to be able to copy the dy and dx values, use the field calculator to add a virtual field for dy and one for dx. Copy the dy and dx values from the Identify tool.