3

I created a Distance matrix from a vector layer of 36 points. I want to show all the distance lines between all the points.

In the Distance matrix layer, I click Properties > Symbology, then under the Symbol layer type I use Geometry Generator. Under Geometry type I select LineString/MultiLineString. Units are Map Units.

Finally, I use this code:

make_line(
    geometry(
        get_feature('Site Type 2', 'id', "InputID")
        ), 
    geometry(
        get_feature('Site Type 2', 'id', "TargetID")
        )
    )

When I click Apply, nothing happens. Any thoughts?

Taras
  • 32,823
  • 4
  • 66
  • 137
user199903
  • 33
  • 2

1 Answers1

1

Your expression should work, as long Site Type 2 is the name of the initial point layer (not the Distance matrix layer). Otherwise, you can also use (a bit shorter) get_feature_by_id:

make_line (
    geometry (get_feature_by_id('Site Type 2', "InputID")),
    geometry (get_feature_by_id('Site Type 2', "TargetID"))
)

enter image description here

Babel
  • 71,072
  • 14
  • 78
  • 208