0% found this document useful (0 votes)
187 views

Material Atlas Qgis Tutorial

Tutorial para la creacion de atlas de mapas automaticos en software libre qgis

Uploaded by

Fernando Estrada
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
187 views

Material Atlas Qgis Tutorial

Tutorial para la creacion de atlas de mapas automaticos en software libre qgis

Uploaded by

Fernando Estrada
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

Material Design Atlas

With Qgis Composer

y
Summary
Requirements :.................................................................................................................................................................................................................................................................... 3
PART 1 - Design Cards........................................................................................................................................................................................4
Add a Grey background.................................................................................................................................................................................................................................................... 5
Add Material Design Cards.............................................................................................................................................................................................................................................. 6
PART 2 Configure Layer..................................................................................................................................................................................7
Set your layer style for different views........................................................................................................................................................................................................................ 8
PART 3 Map & Zoom.......................................................................................................................................................................................9
Add a map into the map box........................................................................................................................................................................................................................................ 10
Add another map into the Zoom box........................................................................................................................................................................................................................ 11
Add Atlas functionality to Zoom................................................................................................................................................................................................................................. 12
Add Legend........................................................................................................................................................................................................................................................................ 13
PART 4 Title & Text........................................................................................................................................................................................14
Add fixed title..................................................................................................................................................................................................................................................................... 15
Add other fixed titles....................................................................................................................................................................................................................................................... 16
PART 5 Icons..................................................................................................................................................................................................17
Add icons............................................................................................................................................................................................................................................................................ 18
Add icons (continued).................................................................................................................................................................................................................................................... 19
Add map icons.................................................................................................................................................................................................................................................................. 20
Add map icons (continued).......................................................................................................................................................................................................................................... 21
PART 6 Dynamic Blocks................................................................................................................................................................................22
Activating atlas................................................................................................................................................................................................................................................................. 23
Add description................................................................................................................................................................................................................................................................. 24
Add details.......................................................................................................................................................................................................................................................................... 27
Add attribute table........................................................................................................................................................................................................................................................... 28
Add Statistics.................................................................................................................................................................................................................................................................... 31

QGIS Tutorial 2
Requirements :

In this tutorial Im using GEOFLA Communes from IGN that can be downloaded here : https://www.data.gouv.fr/fr/datasets/geofla-
communes/

You can use another, but remember to make correspond attributes with all expressions.

I recommend to use :

Google Fonts that you can find at https://fonts.google.com/?query=roboto

Google material Icons : https://github.com/google/material-design-icons

Or download separately from : https://design.google.com/icons/

For colors :
#d91e3d

#f2f2f2

#262d32

For css in part 6 (for pie charts) : https://drive.google.com/open?id=0B37RnaYSMWAZbVlBT1dndVNuSkE

And always use roboto fonts corresponding to your taste.

QGIS Tutorial 3
PART 1 - Design Cards

QGIS Tutorial 4
Add a Grey background
Change background color to Grey color to make white card visible and use for example these colors :

#f2f2f2

QGIS Tutorial 5
Add Material Design Cards
Create box with add rectangle, without border but draw effect :

Use drop shadow


- Offset 2 Millimeter
- Blur radius to 10
- Transparency to 40 %
Use white or dark Grey fill colors :

White : #ffffff Dark Grey : #262d32

QGIS Tutorial 6
PART 2 Configure Layer

QGIS Tutorial 7
Set your layer style for different views
Set a rule-based style with these settings for example :

For ZOOM view only set your style with : $id=$atlasfeatureid AND $map='ZOOM' (In example City )
For GENERAL view for all features in layer set your style with : $map='GENERAL' (In example Cities )
For GENERAL view but the selected feature by atlas set your style with : $id=$atlasfeatureid AND $map='GENERAL' (In example
Selected )
Don't worry about the map that has disappeared

QGIS Tutorial 8
PART 3 Map & Zoom

QGIS Tutorial 9
Add a map into the map box
Add a map with add new map with the same size of the map box.

Set Item ID to GENERAL according to layer setting


Then change map background if needed and set the map position correctly.

QGIS Tutorial 10
Add another map into the Zoom box
Add a map with add new map with the same size of the map box.

Set Item ID to ZOOM according to layer setting


Then change map background if needed and set the map position correctly.

QGIS Tutorial 11
Add Atlas functionality
In atlas generation tab, check
generate atlas and set coverage
layer with your layer

Add Atlas functionality to Zoom


In Item properties tab, check controlled by atlas

QGIS Tutorial 12
Add Legend
Add a legend with add legend, select the Map according to the map and then check Auto update and Filter legend by map content.

Remove background color from legend set the font color to white.

QGIS Tutorial 13
PART 4 Title & Text

QGIS Tutorial 14
Add fixed title
Add a fixed title with add text with the same width of the map box.

Enter your title set color to #d91e3d then align to middle an center then set background to white.

QGIS Tutorial 15
Add other fixed titles
Add a fixed title with add text .

Set colors and background according to the boxes.

QGIS Tutorial 16
PART 5 Icons

QGIS Tutorial 17
Add icons
Add some icons with add image and put them next to the cards title.

QGIS Tutorial 18
Add icons (continued)
Add other icons with add image and put them on details card.

QGIS Tutorial 19
Add map icons
Add circle background for map icon with add eclipse, then set color and add draw effect.

QGIS Tutorial 20
Add map icons (continued)
Add map icons with add image and put them on details card.
Get them aligned to center.

QGIS Tutorial 21
PART 6 Dynamic Blocks

QGIS Tutorial 22
Activating atlas
Now its time to activate Atlas preview feature and see some things changing. Then well add some dynamic blocks to see them change in real-
time.
Click on Atlas preview on atlas toolbar.

QGIS Tutorial 23
Add description
Add an html description with add HTML frame and remove background.
In example, I use some lorem ipsum with Qgis expressions and html language to get dynamic description. You can use and adapt this code to
your needs and attributes name :

<body style="font-family:roboto light;">

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin<span style="color:#d91e3d;font-weight:bold;">
[% "NOM_COM" %]</span> cursus arcu vitae vestibulum. Praesent faucibus imperdiet elit, eu volutpat mi <span
style="color:#d91e3d;font-weight:bold;"> [% "POPULATION" || ' Residents'%]</span> at. Nulla dui velit, feugiat
eget enim ac,<span style="color:#d91e3d;font-weight:bold;"> [% "SUPERFICIE" || ' Ha'%]</span> pharetra
libero.</p>
</body>

QGIS Tutorial 24
To insert Qgis expressions like [% "NOM_COM" %] in your text just click on Insert an expression and then in Fields an Values double-click on
NOM_COM (or your attribute name if different) and then OK

QGIS Tutorial 25
Add some details to Description card like simple arrow with Arrow markers to None and set Line style to Grey

Then just add a text with Qgis expression, in example just [% "NOM_COM" %]

QGIS Tutorial 26
Add details
With the same method before, add an html description with add HTML frame and remove background.

For your date you can add this code :

Created on : [% format_date( now() , 'MM/dd/yyyy')%]

And for the others add the text corresponding to your project.

QGIS Tutorial 27
Add attribute table
Add an attribute table with add attribute table and select the right layer. Then use these settings :

- Set Maximum rows corresponding to your layer (Here at least 30)


- Check Show only features intersecting atlas feature
- Uncheck Show grid
- Use google roboto fonts
- Set fonts like this :

- Appearance settings like this :

QGIS Tutorial 28
- Use these color settings :

QGIS Tutorial 29
- And set attributes like this :

QGIS Tutorial 30
Add Statistics
First, add some html labels with add HTML frame with for example these codes to adapt to your project :

Area

[% "SUPERFICIE" %] Ha

Population
[% "POPULATION" %] hab

QGIS Tutorial 31
Then add HTML frames with this code for area :

<div class="demo-wrapper">
<div class="csspie" data-start="0" data-value="[% to_int( (( "SUPERFICIE" *100 ) / 250308 ) )
%]"></div>
<div class="csspie big" data-start="[% to_int( (( "SUPERFICIE" *100 ) / 250308 ) )%]" data-
value="[% (100 - to_int( (( "SUPERFICIE" *100 ) / 250308 ) ))%]"></div>
</div>

In this example Im calculating a percentage, with fields and sum of all values (250308) for dynamically give sizes to the pie.

Then ccs sheet will make all the rest. (Css sheet in source)

And this code for population :

<div class="demo-wrapper">
<div class="csspie" data-start="0" data-value="[% to_int( (( "POPULATION" *100 ) / 833944 ) )
%]"></div>
<div class="csspie big" data-start="[% to_int( (( "POPULATION" *100 ) / 833944 ) )%]" data-
value="[% (100 - to_int( (( "POPULATION" *100 ) / 833944 ) ))%]"></div>
</div>

In this example Im calculating a percentage, with fields and sum of all values (833944) for dynamically give sizes to the pie.

Then ccs sheet will make all the rest. (Css sheet in source)

Im using to_int() to get integer value corresponding to css rules. But later I will use decimal values for labels.

QGIS Tutorial 32
Then copy and past css in source in user style-sheet to get this :

QGIS Tutorial 33
To finish add text labels over pie charts using Qgis expressions.

For area :
[% round( (( "SUPERFICIE" *100 ) / 250308 ) ,1)%]%
For population :
[% round( (( "POPULATION" *100 ) / 833944 ) ,1)%]%

Now you can export your atlas with export atlas to PDF in atlas toolbar drop-down !

QGIS Tutorial 34
Well Done!
Youve got a materialized atlas ready map

This tutorial is proudly created with open source softwares like Qgis, inkscape and LibreOffice.
Thanks to Anita Graser for her help and for her amazing book Qgis Map Design.

Mickael HOARAU
https://twitter.com/Oneil974

QGIS Tutorial 35

You might also like