3

I need to set up way signs for something like a "hiking-GIS". In the first step I made a network analysis (using QNEAT3) to find the distance from the signs ("Way Signs") to the available destinations ("Destinations") along the trail network ("Ways"). The result is the "OD-Matrix". So far so good... to see all destination distances for every single sign, I was setting up a 1:n relation via project properties. You can see all relevant results in the screenshot:

enter image description here

I'm able to see all destinations with distances in the attribute form - great! But I need to get for every sign all it's destinations with distance. To get a real printable sign, I thought about to use the Atlas to switch trough every sign (layer 'Way Signs' as coverage layer) and use a expression text field to show the destinations with distances.

So the question is: How do I get the 1:n related attributes via expressions to use them in the Atlas (or anywhere else)?

enter image description here

  • 1
    The aggregate functions include relation_aggregate(relation,aggregate,expression[,concatenator]) which is specifically for use with relations. I've never used it because I rarely use relations, but maybe it will help. – csk Nov 15 '19 at 21:31
1

A starting point with expressions would be to use the Aggregate and Array functions: A construct like the following will put all destinations (from the joined layer) in an array which belongs to the current atlas feature:

string_to_array(
Aggregate(
layer:='OD-Matrix',
aggregate:='concatenate', 
expression:="destination_id", concatenator:=',',
filter:="origin_id"=attribute( @atlas_feature, 'name')))

with array_get() you can access the members of the array

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.