1

I'm having difficulty with the geometry generator. Here is my very basic code:

make_line( 
geometry(get_feature('New_scratch_layer_f7ec7875_1bec_46b6_84dd_46bca8f2d978', 'name', 'a')), 
geometry(get_feature('New_scratch_layer_f7ec7875_1bec_46b6_84dd_46bca8f2d978', 'name', 'b')),
geometry(get_feature('New_scratch_layer_f7ec7875_1bec_46b6_84dd_46bca8f2d978', 'name', 'c')
)
)

I don't understand why it only draws one line.

enter image description here

Ideally I would like it to draw a line between points grouped by type without the name attribute.

This would be very useful.

1

1 Answer 1

2

You can use array_agg to create arrays of points grouped by typ field and orderer by name:

 make_line( 
  array_agg(expression:=$geometry, group_by:="typ", order_by:="name"))

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.