2

I'm using QGIS 2.18 (Las Palmas). I have an attribute table with 75 municipalities and around 50 attributes. I would like to creat a map for each of the attribute (always showing all of the municipalities at once) in graduated categories (preferably with values). I know that by using the Atlas-Function i can create a series of maps, but it seem like i can only do that for each of the municipilities but not for the attributes. I have looked around in Stackexchange and i found similar questions that were unfortunately unanswered. I also read that you should tranpose the data, but i fear that i wouldnt be able to see the municipalities any longer. Any suggestions?

5

Step 1: Categorize your original shapefile

Stylize your original shapefile with graduated categories based on the first of your 50 attributes. enter image description here

enter image description here

Rename the layer (NOT the original shapefile) to include the name of the first attribute. Eg, this layer would now be called LayerName_Attribute1

Duplicate the layer

Layers Panel > right click on the layer name > "Duplicate"

Set up graduated categories for attribute number 2. Rename this layer as LayerName_Attribute2

Repeat until you have 50 or so layers, one for each attribute. Note that you haven't created any new shapefiles, so if you make changes to the original shapefile all of your layers will also be updated.

Step 2: Make a coverage layer

Create a new polygon shapefile, let's call it coveragelayer. Add one text field, "Attribute Name". Make a polygon that encompasses all of your municipalities. Copy and paste that polygon until you have one polygon for each of the 50 attributes. In the text field, give each polygon a unique title that corresponds to each of the 50 attributes (Attribute1, Attribute2, ...) enter image description here

Step 3: Create a visibility preset for each layer

In the layers panel, turn on "LayerName_Attribute1" and any other layers you want in your atlas. Create a visibility preset called Attribute1. Turn off "LayerName_Attribute1," turn on "LayerName_Attribute2" and create another preset called Attribute2. Repeat until you have a visibility preset for each attribute.

Step 4: Generate an atlas

In Print Composer, create an atlas using the layer created in step 2 as the coverage layer. Set the atlas pagename to the text field "Attribute." enter image description here

Add a map to the layout and check the box for "Controlled by Atlas." Under the map's

Item Properties > Layers > check the box for "Follow visibility preset" > click the button for "data defined override" > Edit

Enter the expression

@atlas_pagename

enter image description here

Note that the layer visibility is controlled by the coverage layer field called "Attribute." If the layers don't display correctly, go back and check that the values in this field are identical to the layer visibility preset names.

  • csk, i finally got around to tryout your approach and it worked wonderfully. thank you so much for your help, its definately less time consuming than creating a seperate map for each attribute! – rtaani May 31 '17 at 15:27
  • I'm glad I could help. Please consider clicking the check mark next to my answer to accept it as the best answer to your question. – csk Jun 21 '17 at 19:02

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.