I am trying to pull together data from the attribute table based on which the atlas is created. I want the query to display the information if it occurs within the Atlas feature. In my project I am trying to produce maps of various parks and then pull details of various features in it. For example, a park may have playgrounds, barbecues, water fountains etc. and want information displayed just for those features. There are many more attributes. Just to clarify, all this information is present in the parks layer.
I am so far tried the following query and it works as long as the features exist in the atlas feature. If they don't the attribute query fails which is not what I want. Here's an example of the query:
[%'ASSET KEY' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || 'ASSET NAME' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' ||'AREA (SQ. M.)' || '\n' || '\n' ||
title("pg_key")|| '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || title("pg_nam") || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || "pg_area" || '\n' || '\n' ||
title( "skt_key") || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || title("skt_nam") || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' ||'\t' ||"skt_area" ||'\n' || '\n' ||
title( "bmx_key") || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || title("bmx_nam") || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' || '\t' ||'\t' ||'\t' ||"bmx_area"%]
In the above example, the query works as long as the features pg, skt and bmx occur within the park. Even if one doesn't the query fails. I want to create this query for all the possible scenarios so that the atlas puts the correct information in each of the maps.
With this one, I would like to information associated with green, red and blue hatching and the football icon. However, there are many other features within parks that are not present in this park here. So I want to set up the query for all the possible scenarios so that I don't have to manually change it for the 400 odd maps that I'm trying to produce. In the example below, if I try and put down a query for all the possible scenarios, it is failing as soon as one of the features that is not a part of the park is mentioned in the query.
This is how I would like the information to appear below the map. I tried to use the attribute table directly but the manner in which the data is organised in the atlas layer does not let me know populate the data row-wise. In other words, each park is a row and all the features whether present in the park are linked to the single row in separate columns.
This screen dump below shows how the features are linked to the different parks as separate columns.
I have since morning tried to tackle this problem differently. Rather than linking all the features to each and every row in the park, I have tried to keep the features in separate layers and then use a query to pull the desired information. Even this approach does not seem to work. The query I'm using is as follows:
"BMX_NAME" =attribute( $atlasfeature ,'bmx_nam')
BMX_NAME is a column name in a separate layer called BMX whilst the parks layer has the name of the BMX track under the column bmx_nam. This query doesn't work even though my current atlas feature has a BMX track. So I'm back to square one now. If this works then it would solve the problem I think...
Any suggestions?
I changed the query to the following and it still does not work.
"BMX_NAME"=attribute(@atlas_feature , 'bmx_nam')