I am making an atlas where I want to expose features with specific values. A good way to illustrate this could be this real estate database:

01 estate_a expensive yellowhouse
02 estate_b expensive yellowhouse
03 estate_c cheap     greenhouse
04 estate_d cheap     brownhouse
05 estate_e expensive greenhouse

The current atlas functionality in QGIS (2.18.0) supports making an atlas with one map for each estate. I want to make one map with all expensive estates and one with all cheap estates. Is this possible?

Also - can I have different symbols according to different house colors?


Create a coverage layer where all expensive estates are merged and all cheap extents are merged so you have only 2 features - make sure you have an attribute called "estate_type" and fill that with expensive or cheap.

Then in the symbol properties of your estate layers change the symbol to rule based.

Add a rule like below

 attribute(  $currentfeature , 'estate_type') =  attribute(  @atlas_feature , 'estate_type')

If the atlas is on the 'cheap' feature in the coverage layer it will symbolise all the cheap estates; when you change to the 'expensive' feature in the coverage layer it will symbolise all the expensive ones.enter image description here

In your question you also want to symbolise the houses differently according to a color attribute. You can maintain any styling. Just choose your favourite symbolising and symbolize. After this you change to Rule-based styling and add the string before all rules. Your rules et will then look like this:

attribute(  $currentfeature , 'estate_type') =  attribute(  @atlas_feature , 'estate_type') AND "housecolor" = 'yellowhouse'
attribute(  $currentfeature , 'estate_type') =  attribute(  @atlas_feature , 'estate_type') AND "housecolor" = 'greenhouse'
attribute(  $currentfeature , 'estate_type') =  attribute(  @atlas_feature , 'estate_type') AND "housecolor" = 'brownhouse'

The above figure is an example of how I use it. I have an ELSE rule to symbolise all other features that aren't part of my coverage layer. Leave this out if you don't want them visible.

  • This works well for presenting all estates in an equal way. What if I want to identify the objects by their object number, or if say, the objects had different colors and I wanted to indicate this in the map? – ragnvald Nov 29 '16 at 6:58
  • Figured it out! The following: attribute( $currentfeature , 'estate_type') = attribute( atlas_feature , 'estate_type') AND attribute( $currentfeature , 'estate_type') = 'expensive' made it possible to have different colors for different attributes. So if I had different house colors I could probably add that dimension this way: attribute( $currentfeature , 'estate_type') = attribute( atlas_feature , 'estate_type') AND attribute( $currentfeature , 'estate_type') = 'expensive' AND attribute( $currentfeature , 'house_color') = 'Yellow' (atlas_feature has an @ in front) – ragnvald Nov 29 '16 at 7:59
  • Either create a set of rules and add this rule to it. Or right click and add a category or new rule set nested to this rule – Liam G Nov 29 '16 at 8:00
  • Implement the added dimension to your answer and I will accept it straight. My question has been updated to support an extended answer. – ragnvald Nov 29 '16 at 8:08
  • Updated the answer with my own experiences. Good answer from @Freight_Train - thankyou! – ragnvald Nov 30 '16 at 19:57

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.