From the following table structure with the fields "ORIG_LATITUDE", "ORIG_LONGITUDE", "DEST_LATITUDE", "DEST_LONGITUDE"
:
I clarify that the field names describe with their prefix the coordinates belonging to the Origin (ORIG) and Destination (DEST).
I would like to draw an arrow with the make_line
function that connects the point defined by the fields of each record "ORIG_LATITUDE", "ORIG_LONGITUDE"
with the fields "DEST_LATITUDE", "DEST_LONGITUDE"
, as shown in this image
Best Answer
Use this expression:
If you have a data-only table, without geometry, there are two options: load the table as a point layer first (as recommended by @J.R) or, if you want to avoid this, create directly a new Virtual Layer, containing the lines.
The query in the virtual layer looks like this:
You can then export/save the virtual layer to make the resulting lines permanent (not depending on the table any more).