1

I am working on a site-specific automated report generation system using a template built in the QGIS composer manager, based on the atlas generator. The coverage layer is a 'Site Boundary', effectively polygons defining individual properties in the UK. For each property, I need to be able to build rules based on the attribute values of the features of different layers (e.g layer 1, layer 2, layer 3 etc... not the same as the coverage layer) beneath each Site Boundary, which I will then use to populate the template (using labels). An example of this may be:

If the attribute value of layer 1 beneath the Site Boundary is w, and the attribute value of layer 2 beneath the Site Boundary is x, display y, if not display z. This would need to be done for each Site within the atlas, using the unique attributes beneath each Site Boundary.

So far I have been able to build the atlas based off the Site Boundary layer and add the attribute tables of other layers to the template. I then filtered the results so that only the features that intersect with the Site Boundary are displayed for each Site Boundary within the atlas. However, I can only seem to build expressions based off the coverage layer. I need to be able to build expressions based off the feature attribute values of each layer for each Site Boundary within the Atlas. Is there some way of doing this?

5
  • I am a bit confused by what you mean by layer's metadata. Do you mean attribute values of the layers features? Commented Nov 29, 2017 at 14:17
  • Hi, thanks for your response. Yes, that is what I mean - I'll edit the post to make it clearer
    – bm13563
    Commented Nov 29, 2017 at 14:41
  • Another thing to clear. What if a layer has several features inside the boundary, what feature's attribute will you use/check? Commented Nov 29, 2017 at 15:50
  • Ideally we would want to check against the attributes of all of the features that intersect the Site Boundary, if that's possible
    – bm13563
    Commented Nov 29, 2017 at 15:53
  • I still not get it. You say "If the attribute value of layer 1 beneath the Site Boundary is w, and the attribute value of layer 2 beneath the Site Boundary is x, display y, if not display z". What do you mean by showing Y and not Z. What are Y and Z? Labels? Features? feature styles? Commented Nov 29, 2017 at 22:36

1 Answer 1

1

I think you might be confusing some terminology here but if I understand your question correctly, you can perform a 'join attributes by location' to get a layer with the attributes of both intersecting layers.

from the 2.18 Documentation

processing.runalg('qgis:joinattributesbylocation', target, join, predicate, summary, stats, keep, output)
1
  • Hi, thanks for your response. I have edited the post to try and make the question clearer. Could you elaborate on this? From my (limited) understanding, a simple spatial join wouldn't work in this scenario since the Site Boundary layer is constantly being updated (a Site Boundary is drawn for each report that we undertake), so the attributes would have to be manually joined for each Site Boundary that is drawn.
    – bm13563
    Commented Nov 29, 2017 at 15:24

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.