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:

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

When I click Apply, nothing happens. Any thoughts?

1 Answer 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

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.