Generating line segments between all points using QGIS
I think that it might be easiest to do with St_ShortestLine with PostGIS http://postgis.net/docs/ST_ShortestLine.html or with a similar ShortestLine function in Spatialite https://www.gaia-gis.it/gaia-sins/xmlBlob/spatialite-sql-latest.html.
You said you have only points but those functions can be used for other geometries as well. Here is an example with Spatialite.
SELECT shortestline(a.geometry,b.geometry) AS geometry,
a.rowid AS start, b.rowid AS end
FROM source_table a, source_table b
WHERE a.rowid<b.rowid;
My technique using the FlowMapper plugin to connect all the points with each other:
- In QGIS, save the point layer to a CSV file, checked "skip attribute creation", selected tab delimiter- only the coordinates should be exported. (I'll call this file A)
- Change the file suffix from .csv to .txt
- Open the file in a text editor and delete “X” and “Y” from the top (save and exit)
- Create a dummy magnitude file in excel/libreoffice calc/whatever. The dummy file must have as many rows and columns as there are points in the point layer (20x20, in my case)
- Save that file as a .csv with either space or tab delimiter. (I'll call this file B)
- Convert the .csv to a .txt
- In QGIS, in the FlowMapper plugin menu, select “Generate flow lines and nodes”.
- Select file A.txt for the node coordinates
- Select file B.txt for the flow magnitudes
- Select “gross” for “flow type”
- Enter a save file name/location for the output line shapefile
- Click “OK”.
The resulting line layer has several attributes that aren't immediately useful to what I'm doing, so I deleted them, but they may be useful to others.
It's kind of a clunky workflow, but without learning PostGIS or Spatialite, it's the best I've managed to do (and it gets the exact result I was hoping for).