Skip to main content
added 22 characters in body
Source Link
Andy Harfoot
  • 3.4k
  • 1
  • 25
  • 35

This is possible using a different 'geometry generator' to the one that you originally intended I suspect, You can avoid having to generate the all connections line layer by using a virtual layer:

Some points:

sample points

Add a virtual layer using the following SQL - the JOIN matches every point to every other, and the line geometry is generated using the Spatialite MakeLine function:

SELECT s.id 'ID1', c.id 'ID2' , MakeLine(s.geometry,c.geometry) 'geometry'
  FROM SamplePoints AS s JOIN SamplePoints AS c 
  WHERE s.id <> c.id

The result:

Points with connecting lines

This virtual table could then be filtered dynamically using the Atlas functionality.

Dynamically generating curved lines would be trickier, but should still be possible. Curving them in a cartographically appropriate way (considering the distribution of the other lines) is probably beyond what can be achieved with virtual layers.

Update:

With a little tinkering and a lot of reference to the Spatialite function list I have generated curved lines:

Points with curved connecting linesPoints with curved connecting lines

The virtual layer SQL for this is below. Note that all permutations are shown, and reversing the order of the start and end location generates the complementary curve.

SELECT s.id 'ID1', c.id 'ID2' , 
MakeArc(
    X(Project(MakePoint((X(s.geometry)+X(c.geometry))/2,(Y(s.geometry)+Y(c.geometry))/2),distance(s.geometry,c.geometry),Azimuth(s.geometry,c.geometry) - PI()/2)),
    Y(Project(MakePoint((X(s.geometry)+X(c.geometry))/2,(Y(s.geometry)+Y(c.geometry))/2),distance(s.geometry,c.geometry),Azimuth(s.geometry,c.geometry) - PI()/2)),
    distance(s.geometry,c.geometry) * 1.1180339887,
    90 - azimuth(Project(MakePoint((X(s.geometry)+X(c.geometry))/2,(Y(s.geometry)+Y(c.geometry))/2),distance(s.geometry,c.geometry),Azimuth(s.geometry,c.geometry) - PI()/2),s.geometry) * (180/PI()),
    90 - azimuth(Project(MakePoint((X(s.geometry)+X(c.geometry))/2,(Y(s.geometry)+Y(c.geometry))/2),distance(s.geometry,c.geometry),Azimuth(s.geometry,c.geometry) - PI()/2),c.geometry) * (180/PI()),
    27700,
    2) 'geom' /*line:27700*/
  FROM SamplePoints AS s JOIN SamplePoints AS c 
  WHERE s.id <> c.id

This is possible using a different 'geometry generator' to the one that you originally intended I suspect, You can avoid having to generate the all connections line layer by using a virtual layer:

Some points:

sample points

Add a virtual layer using the following SQL - the JOIN matches every point to every other, and the line geometry is generated using the Spatialite MakeLine function:

SELECT s.id 'ID1', c.id 'ID2' , MakeLine(s.geometry,c.geometry) 'geometry'
  FROM SamplePoints AS s JOIN SamplePoints AS c 
  WHERE s.id <> c.id

The result:

Points with connecting lines

This virtual table could then be filtered dynamically using the Atlas functionality.

Dynamically generating curved lines would be trickier, but should still be possible. Curving them in a cartographically appropriate way (considering the distribution of the other lines) is probably beyond what can be achieved with virtual layers.

Update:

With a little tinkering and a lot of reference to the Spatialite function list I have generated curved lines:

Points with curved connecting lines

The virtual layer SQL for this is below. Note that all permutations are shown, and reversing the order of the start and end location generates the complementary curve.

SELECT s.id 'ID1', c.id 'ID2' , 
MakeArc(
    X(Project(MakePoint((X(s.geometry)+X(c.geometry))/2,(Y(s.geometry)+Y(c.geometry))/2),distance(s.geometry,c.geometry),Azimuth(s.geometry,c.geometry) - PI()/2)),
    Y(Project(MakePoint((X(s.geometry)+X(c.geometry))/2,(Y(s.geometry)+Y(c.geometry))/2),distance(s.geometry,c.geometry),Azimuth(s.geometry,c.geometry) - PI()/2)),
    distance(s.geometry,c.geometry) * 1.1180339887,
    90 - azimuth(Project(MakePoint((X(s.geometry)+X(c.geometry))/2,(Y(s.geometry)+Y(c.geometry))/2),distance(s.geometry,c.geometry),Azimuth(s.geometry,c.geometry) - PI()/2),s.geometry) * (180/PI()),
    90 - azimuth(Project(MakePoint((X(s.geometry)+X(c.geometry))/2,(Y(s.geometry)+Y(c.geometry))/2),distance(s.geometry,c.geometry),Azimuth(s.geometry,c.geometry) - PI()/2),c.geometry) * (180/PI())) 'geom' /*line:27700*/
  FROM SamplePoints AS s JOIN SamplePoints AS c 
  WHERE s.id <> c.id

This is possible using a different 'geometry generator' to the one that you originally intended I suspect, You can avoid having to generate the all connections line layer by using a virtual layer:

Some points:

sample points

Add a virtual layer using the following SQL - the JOIN matches every point to every other, and the line geometry is generated using the Spatialite MakeLine function:

SELECT s.id 'ID1', c.id 'ID2' , MakeLine(s.geometry,c.geometry) 'geometry'
  FROM SamplePoints AS s JOIN SamplePoints AS c 
  WHERE s.id <> c.id

The result:

Points with connecting lines

This virtual table could then be filtered dynamically using the Atlas functionality.

Dynamically generating curved lines would be trickier, but should still be possible. Curving them in a cartographically appropriate way (considering the distribution of the other lines) is probably beyond what can be achieved with virtual layers.

Update:

With a little tinkering and a lot of reference to the Spatialite function list I have generated curved lines:

Points with curved connecting lines

The virtual layer SQL for this is below. Note that all permutations are shown, and reversing the order of the start and end location generates the complementary curve.

SELECT s.id 'ID1', c.id 'ID2' , 
MakeArc(
    X(Project(MakePoint((X(s.geometry)+X(c.geometry))/2,(Y(s.geometry)+Y(c.geometry))/2),distance(s.geometry,c.geometry),Azimuth(s.geometry,c.geometry) - PI()/2)),
    Y(Project(MakePoint((X(s.geometry)+X(c.geometry))/2,(Y(s.geometry)+Y(c.geometry))/2),distance(s.geometry,c.geometry),Azimuth(s.geometry,c.geometry) - PI()/2)),
    distance(s.geometry,c.geometry) * 1.1180339887,
    90 - azimuth(Project(MakePoint((X(s.geometry)+X(c.geometry))/2,(Y(s.geometry)+Y(c.geometry))/2),distance(s.geometry,c.geometry),Azimuth(s.geometry,c.geometry) - PI()/2),s.geometry) * (180/PI()),
    90 - azimuth(Project(MakePoint((X(s.geometry)+X(c.geometry))/2,(Y(s.geometry)+Y(c.geometry))/2),distance(s.geometry,c.geometry),Azimuth(s.geometry,c.geometry) - PI()/2),c.geometry) * (180/PI()),
    27700,
    2) 'geom' /*line:27700*/
  FROM SamplePoints AS s JOIN SamplePoints AS c 
  WHERE s.id <> c.id
Added curved line example
Source Link
Andy Harfoot
  • 3.4k
  • 1
  • 25
  • 35
SELECT s.id 'ID1', c.id 'ID2' , MakeLine(s.geometry,c.geometry) 'geometry'
  FROM SamplePoints AS s JOIN SamplePoints AS c 
  WHERE s.id <> c.id
SELECT s.id 'ID1', c.id 'ID2' , MakeLine(s.geometry,c.geometry) 'geometry'
  FROM SamplePoints AS s JOIN SamplePoints AS c 
  WHERE s.id <> c.id

Dynamically generating curved lines would be trickier, but should still be possible. Curving them in a cartographically appropriate way (considering the distribution of the other lines) is probably beyond what can be achieved with virtual layers.

Update:

With a little tinkering and a lot of reference to the Spatialite function list I have generated curved lines:

Points with curved connecting lines

The virtual layer SQL for this is below. Note that all permutations are shown, and reversing the order of the start and end location generates the complementary curve.

SELECT s.id 'ID1', c.id 'ID2' , 
MakeArc(
    X(Project(MakePoint((X(s.geometry)+X(c.geometry))/2,(Y(s.geometry)+Y(c.geometry))/2),distance(s.geometry,c.geometry),Azimuth(s.geometry,c.geometry) - PI()/2)),
    Y(Project(MakePoint((X(s.geometry)+X(c.geometry))/2,(Y(s.geometry)+Y(c.geometry))/2),distance(s.geometry,c.geometry),Azimuth(s.geometry,c.geometry) - PI()/2)),
    distance(s.geometry,c.geometry) * 1.1180339887,
    90 - azimuth(Project(MakePoint((X(s.geometry)+X(c.geometry))/2,(Y(s.geometry)+Y(c.geometry))/2),distance(s.geometry,c.geometry),Azimuth(s.geometry,c.geometry) - PI()/2),s.geometry) * (180/PI()),
    90 - azimuth(Project(MakePoint((X(s.geometry)+X(c.geometry))/2,(Y(s.geometry)+Y(c.geometry))/2),distance(s.geometry,c.geometry),Azimuth(s.geometry,c.geometry) - PI()/2),c.geometry) * (180/PI())) 'geom' /*line:27700*/
  FROM SamplePoints AS s JOIN SamplePoints AS c 
  WHERE s.id <> c.id
SELECT s.id 'ID1', c.id 'ID2' , MakeLine(s.geometry,c.geometry) 'geometry'
  FROM SamplePoints AS s JOIN SamplePoints AS c 
  WHERE s.id <> c.id

Dynamically generating curved lines would be trickier, but should still be possible. Curving them in a cartographically appropriate way (considering the distribution of the other lines) is probably beyond what can be achieved with virtual layers.

SELECT s.id 'ID1', c.id 'ID2' , MakeLine(s.geometry,c.geometry) 'geometry'
  FROM SamplePoints AS s JOIN SamplePoints AS c 
  WHERE s.id <> c.id

Dynamically generating curved lines would be trickier, but should still be possible. Curving them in a cartographically appropriate way (considering the distribution of the other lines) is probably beyond what can be achieved with virtual layers.

Update:

With a little tinkering and a lot of reference to the Spatialite function list I have generated curved lines:

Points with curved connecting lines

The virtual layer SQL for this is below. Note that all permutations are shown, and reversing the order of the start and end location generates the complementary curve.

SELECT s.id 'ID1', c.id 'ID2' , 
MakeArc(
    X(Project(MakePoint((X(s.geometry)+X(c.geometry))/2,(Y(s.geometry)+Y(c.geometry))/2),distance(s.geometry,c.geometry),Azimuth(s.geometry,c.geometry) - PI()/2)),
    Y(Project(MakePoint((X(s.geometry)+X(c.geometry))/2,(Y(s.geometry)+Y(c.geometry))/2),distance(s.geometry,c.geometry),Azimuth(s.geometry,c.geometry) - PI()/2)),
    distance(s.geometry,c.geometry) * 1.1180339887,
    90 - azimuth(Project(MakePoint((X(s.geometry)+X(c.geometry))/2,(Y(s.geometry)+Y(c.geometry))/2),distance(s.geometry,c.geometry),Azimuth(s.geometry,c.geometry) - PI()/2),s.geometry) * (180/PI()),
    90 - azimuth(Project(MakePoint((X(s.geometry)+X(c.geometry))/2,(Y(s.geometry)+Y(c.geometry))/2),distance(s.geometry,c.geometry),Azimuth(s.geometry,c.geometry) - PI()/2),c.geometry) * (180/PI())) 'geom' /*line:27700*/
  FROM SamplePoints AS s JOIN SamplePoints AS c 
  WHERE s.id <> c.id
added 250 characters in body
Source Link
Andy Harfoot
  • 3.4k
  • 1
  • 25
  • 35

This is possible using a different 'geometry generator' to the one that you originally intended I suspect, You can avoid having to generate the all connections line layer by using a virtual layer:

Some points:

sample points

Add a virtual layer using the following SQL - the JOIN matches every point to every other, and the line geometry is generated using the Spatialite MakeLine function:

SELECT s.id 'ID1', c.id 'ID2' , MakeLine(s.geometry,c.geometry) 'geometry'
  FROM SamplePoints AS s JOIN SamplePoints AS c 
  WHERE s.id <> c.id

The result:

Points with connecting lines

This virtual table could then be filtered dynamically using the Atlas functionality.

Dynamically generating curved lines would be trickier, but should still be possible. Curving them in a cartographically appropriate way (considering the distribution of the other lines) is probably beyond what can be achieved with virtual layers.

This is possible using a different 'geometry generator' to the one that you originally intended I suspect, You can avoid having to generate the all connections line layer by using a virtual layer:

Some points:

sample points

Add a virtual layer using the following SQL - the JOIN matches every point to every other, and the line geometry is generated using the Spatialite MakeLine function:

SELECT s.id 'ID1', c.id 'ID2' , MakeLine(s.geometry,c.geometry) 'geometry'
  FROM SamplePoints AS s JOIN SamplePoints AS c 
  WHERE s.id <> c.id

The result:

Points with connecting lines

This virtual table could then be filtered dynamically using the Atlas functionality.

This is possible using a different 'geometry generator' to the one that you originally intended I suspect, You can avoid having to generate the all connections line layer by using a virtual layer:

Some points:

sample points

Add a virtual layer using the following SQL - the JOIN matches every point to every other, and the line geometry is generated using the Spatialite MakeLine function:

SELECT s.id 'ID1', c.id 'ID2' , MakeLine(s.geometry,c.geometry) 'geometry'
  FROM SamplePoints AS s JOIN SamplePoints AS c 
  WHERE s.id <> c.id

The result:

Points with connecting lines

This virtual table could then be filtered dynamically using the Atlas functionality.

Dynamically generating curved lines would be trickier, but should still be possible. Curving them in a cartographically appropriate way (considering the distribution of the other lines) is probably beyond what can be achieved with virtual layers.

Source Link
Andy Harfoot
  • 3.4k
  • 1
  • 25
  • 35
Loading