0

I'll try and lay this out clearly, I have most of it covered, but there's a very specific thing I'm looking for in the rules - whether or not it can be done and if so, how?

Key things I have done and/or plan as outcomes;

  • QGIS 3.4.2
  • A dataset of just over 556000 rows - all points representing one building each
  • 583 groupings for each by round which are unique, the name covers region, service, round number and day like so '(SH) Food 1 Mon'
  • These rounds have anywhere between a few hundred and several thousand points in each
  • The groupings have been first set as categorised and then Rule-Based so each round is split out from the others
  • They're to be exported via an atlas and show one round at a time (once I've bounding geometry to use for each round) and all will have the same symbols - with only one round showing each time, there's no demand to have different symbols

I'm looking to use an atlas due to the volume of images this will produce, doing it by hand would take an age.

Previously when doing similar work on far less categories I've used this code and adapted it for each category (this is using the round example from above)

if("Round Name" = @atlas_pagename, "Round Name" = '(SH) Food 1 Mon', Null)

That works perfectly once all categories have the right round name in before the Null and also the ELSE category has been deleted.

Now here's where I've become stuck - with 583, it takes an awfully long time to change each category by hand once I've moved from Categorised to Rule-Based.

So, the key question here is this; there a way of putting a variable in where I've been typing the round name in order to have QGIS do that part for me by reading and using each round name for each category?

I've looked around on here and not found anything apart from using some Python script which I'm not very handy with so thought I'd ask this first before trying to get my head around that.

I think that covers it and hopefully it's all clear!

  • I'm not sure exactly what you're trying to accomplish. Is it only about showing certain points on every atlas page? How are the atlas pages defined? Can a direct match be made from a field value to the atlas page? – Gabriel C. Jan 8 at 16:42
  • That's a possibility actually, not built the bounding layer yet so could try that. Essentially I'm trying to have the text of the round name filled out by QGIS and not me, so it needs to read it from the Round Name field and print it there in the expression. Without that, I end up doing them by hand so lots of clicking, copy, paste etc etc to make all the rules unique – Fordonian Jan 8 at 16:49
  • If that's the case, you only need one rule where that field needs to match the atlas page and that's it. Features will only show when the correct atlas page is active. – Gabriel C. Jan 8 at 16:53
  • Also if you need to get the round name field value of each feature in an expression, take a look at this function attribute( $currentfeature , "your_field") under the Record and Attributes section. If this covers what you need then the suggestions in the comments can be put into a useful answer form. – Gabriel C. Jan 8 at 17:03
  • @GabrielC.thanks! Been having a look at that other post too. Will have another look later once home – Fordonian Jan 8 at 17:06

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.