Skip to main content
added 164 characters in body
Source Link
Taras
  • 34k
  • 4
  • 73
  • 148

You can use SQL to create a virtual layer."Virtual Layer" via Layer/ Add layer/ add-edit virtual layer:

select row_number() over() as new_id,
        a.id as a_id,
        b.id as b_id,
        setsrid( make_line(a.geometry, b.geometry), st_srid(a.geometry)) as geometry
from myPoints as a
cross join myPoints as b
where a.id < b.id

The query joins the layer to itself where ids are different, then creates a line between the joined points.

You need a unique id column, my is named id. Replace id in a.id and b.id with the name of your id column. And replace myPoints with your layer name.   

enter image description here

You can use SQL to create a virtual layer.

select row_number() over() as new_id,
        a.id as a_id,
        b.id as b_id,
        setsrid( make_line(a.geometry, b.geometry), st_srid(a.geometry)) as geometry
from myPoints as a
cross join myPoints as b
where a.id < b.id

The query joins the layer to itself where ids are different, then creates a line between the joined points.

You need a unique id column, my is named id. Replace id in a.id and b.id with the name of your id column. And replace myPoints with your layer name.  enter image description here

You can use SQL to create a "Virtual Layer" via Layer/ Add layer/ add-edit virtual layer:

select row_number() over() as new_id,
        a.id as a_id,
        b.id as b_id,
        setsrid(make_line(a.geometry, b.geometry), st_srid(a.geometry)) as geometry
from myPoints as a
cross join myPoints as b
where a.id < b.id

The query joins the layer to itself where ids are different, then creates a line between the joined points.

You need a unique id column, my is named id. Replace id in a.id and b.id with the name of your id column. And replace myPoints with your layer name. 

enter image description here

added 44 characters in body
Source Link
Bera
  • 77.8k
  • 14
  • 78
  • 188

You can use SQL to create a virtual layer.

select row_number() over() as new_id,
        a.id as a_id,
        b.id as b_id,
        setsrid( make_line(a.geometry, b.geometry), st_srid(a.geometry)) as geometry
from myPoints as a
cross join myPoints as b
where a.id < b.id

The query joins the layer to itself where ids are different, then creates a line between the joined points.

You need a unique id column, my is named id. Replace id in a.id and b.id with the name of your id column. And replace myPoints with your layer name. enter image description here

You can use SQL to create a virtual layer.

select row_number() over() as new_id,
        a.id as a_id,
        b.id as b_id,
        setsrid( make_line(a.geometry, b.geometry), st_srid(a.geometry)) as geometry
from myPoints as a
cross join myPoints as b
where a.id < b.id

The query joins the layer to itself where ids are different, then creates a line between the joined points.

You need a unique id column, my is named id. Replace id in a.id and b.id with the name of your id column. enter image description here

You can use SQL to create a virtual layer.

select row_number() over() as new_id,
        a.id as a_id,
        b.id as b_id,
        setsrid( make_line(a.geometry, b.geometry), st_srid(a.geometry)) as geometry
from myPoints as a
cross join myPoints as b
where a.id < b.id

The query joins the layer to itself where ids are different, then creates a line between the joined points.

You need a unique id column, my is named id. Replace id in a.id and b.id with the name of your id column. And replace myPoints with your layer name. enter image description here

deleted 307 characters in body
Source Link
Bera
  • 77.8k
  • 14
  • 78
  • 188

You can use SQL to create a virtual layer.

select  row_number() over() as new_id, 
        a.id as a_id, 
        b.id as b_id, 
        setsrid( make_line(a.geometry, b.geometry), 3006st_srid(a.geometry)) as geometry
from myPoints as a
cross join myPoints as b
onwhere st_distance(a.geometry,id b.geometry)<10000
where< a.id<bb.id

The query joins the layer to itself where there are other point within 10000 distance units, where their ids are different, then creates a line between themthe joined points.

You need a unique id column, my is named id. Replace id in a.id and b.id with the name of your id column. Replace 3006 with your coordinate system code, myPoints with your point layer name, and 10000 with a distance large enough to include all points (i.e larger than the max distance between the two points farthest apart)

enter image description here enter image description here

You can use SQL to create a virtual layer.

select  row_number() over() as new_id, 
        a.id as a_id, 
        b.id as b_id, 
        setsrid( make_line(a.geometry, b.geometry), 3006) as geometry
from myPoints as a
join myPoints as b
on st_distance(a.geometry, b.geometry)<10000
where a.id<b.id

The query joins the layer to itself where there are other point within 10000 distance units, where their ids are different, then creates a line between them.

You need a unique id column, my is named id. Replace id in a.id and b.id with the name of your id column. Replace 3006 with your coordinate system code, myPoints with your point layer name, and 10000 with a distance large enough to include all points (i.e larger than the max distance between the two points farthest apart)

enter image description here

You can use SQL to create a virtual layer.

select row_number() over() as new_id,
        a.id as a_id,
        b.id as b_id,
        setsrid( make_line(a.geometry, b.geometry), st_srid(a.geometry)) as geometry
from myPoints as a
cross join myPoints as b
where a.id < b.id

The query joins the layer to itself where ids are different, then creates a line between the joined points.

You need a unique id column, my is named id. Replace id in a.id and b.id with the name of your id column. enter image description here

added 56 characters in body
Source Link
Bera
  • 77.8k
  • 14
  • 78
  • 188
Loading
Source Link
Bera
  • 77.8k
  • 14
  • 78
  • 188
Loading