4

I have a list of stations from which I would like to create a network of lines (the one created with the Delaunay triangulation would be fine) identified by a particular ID (for example, "AB" for the line from station A to station B) to which associate a list of measurements I already have (distance etc.).

I tried to use polygons to lines on the Delaunay triangulation layer, but the new lines vector has exactly the same table of it and I can't find a way to discriminate all the lines with a new ID...

This is the main table to which I would like to add all the new lines with the ID listed in the first column: enter image description here

"Fst" and "Matrice di distanza_Distance" are the measurements I need to associate to each line.

These are the tables for the Delaunay triangulation and the Polygons to lines layers, respectively: enter image description here

1 Answer 1

1

I am afraid doing all the task within a GIS software could involve rigorous workflow. (Honestly I do not know how to accomplish it).

May I suggest doing this in two steps, (1) In QGIS create a table of all combination of your stations and their distances, and then save it as a CSV file. (2) Open the output CSV file in a spreadsheet software (Excel, Calc) and create a Look-up table to complete your task.


Please find below only (1)st part; using QGIS.

  1. Create a point shapefile in which you have all your Stations. Make sure its attribute table has an identifier column (in this example, InputID).
  2. Virtual Layer (Go to menu Layer | Add Layer | Add/Edit Virtual Layer).

In the Virtual Layer window;

  1. [Import] your Stations layer.
  2. Fill the query input area:

Query is:

SELECT a.InputID AS INs, 
       b.InputID AS OUTs, 
       Round(st_distance(a.geometry, b.geometry),3) AS Dist_InOut
FROM Your_Stations_Layer  AS a
JOIN Your_Stations_Layer AS b
ON a.InputID <> b.InputID

enter image description here

Sorry I mistakenly entered FI to two points in the above picture, and the records 1 and 3 are different connections. :/

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.