0% found this document useful (0 votes)
0 views32 pages

Procedure For Map Making With QGIs

This document outlines a practical assignment for students to create a design map using QGIS and DataPlotly, focusing on Reunion Island data. It includes detailed steps for installing necessary plugins, filtering data, setting symbology, and creating charts, while emphasizing the use of project variables for color management. The assignment aims to assess students' skills in map design and data visualization techniques.

Uploaded by

MELKIZEDEKI IGWE
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)
0 views32 pages

Procedure For Map Making With QGIs

This document outlines a practical assignment for students to create a design map using QGIS and DataPlotly, focusing on Reunion Island data. It includes detailed steps for installing necessary plugins, filtering data, setting symbology, and creating charts, while emphasizing the use of project variables for color management. The assignment aims to assess students' skills in map design and data visualization techniques.

Uploaded by

MELKIZEDEKI IGWE
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/ 32

QGIS PRACTICAL ASSIGNMENT

Marking Guide

The purpose of this practical is to evaluate students regarding their knowledge and skills
on how to make a design map using QGIS, DataPlotly with the use of variables.

All groups shoud be having QGIS software installed in their computers. The Openstreetmap
data (“© OpenStreetMap contributors”) with QuickOSM (Etienne Trimaille) and
Dataplotly (Matteo Ghetta) for charts will be used. Reunion Island data will be used
(however another dataset can also be used)

Poppins fonts from Google Fonts will be used in this practical, but you may practice using
your choices.

Your work should be well documented step by step: The following items may guide you.

1. Install plugins required


2. Add data to QGIS with QuickOSM base layer
3. Filter data and add new field
4. Add variable colors to QGIS project properties
5. Set symbology for layers
6. Create a composer with standard elements
7. Add charts with expression for colors, text with expressions…
1 - Install plugins required
Go to menu -> plugins -> manage and install plugins

Install QuickOSM and Dataplotly. Select “All plugins” and in search bar add the
name of the required plugin then click install.
2 - Get data with QuickOSM
Launch QuickOSM

Then to get Reunion Island data just set QuickOSM, in quick query add
“admin_level” as key and “8” to value, then go down.
Set “in” and add “reunion”, extend “Advanced” and uncheck “Lines” and
“Multilinestrings” not needed for this tutorial. Then set the “Directory” to use to save
data and to finish click “Run query”. Of course, you can set other country and
parameter fitting your needs

Save your QGIS project !!!


3 - Filter data and add new field
Now we have to filter data to our needs. In this case we need to filter points
to the attributes “place” that are not null. Right click on points and select filter.

Be careful, this step is used only for this dataset and may be different with
another.

In the “query builder” window drop down “Fields” and double click to add it to the
query then add “IS NOT NULL” or “NOT NULL”

Otherwise you can just add the text manually or copy & paste it form here : "place"

IS NOT NULL

This query will filter points to get all the points wee need to label the map.
You should now have something like this.

Our municipalities can be group and we will add a new field “EPCI” to set it with an
expression. First, for a better understanding, rename points as “labels” and
polygons as “municipalities”
Select municipalities and open field calculator

Set field like this “Output field name” set “EPCI”, “Text (string)” as “Type” and
a
length of “10” should be enough
Then add this expression:
CASE

WHEN "name" IN ( 'Entre-Deux' , 'Le Tampon' , 'Saint-Joseph' , 'Saint-Philippe' )


THEN 'CASUD'

WHEN "name" IN ( 'Saint-Pierre' , 'Saint-Louis' , 'Petite-Île' , 'Les Avirons' ,


'L''Étang- Salé' , 'Cilaos' ) THEN 'CIVIS'

WHEN "name" IN ( 'La Possession' , 'Le Port' , 'Les Trois-Bassins' , 'Saint-Leu' , 'Saint-
Paul' ) THEN 'TCO'

WHEN "name" IN ( 'Salazie', 'Sainte-Rose', 'Saint-Benoît' , 'Saint-André' , 'La Plaine-


des-Palmistes' , 'Bras-Panon' ) THEN 'CIREST'
WHEN "name" IN ( 'Saint-Denis' , 'Sainte-Marie' , 'Sainte-Suzanne' ) THEN
'CINOR' ELSE ''
END

Click “OK” then now your layer is in edit mode click on save icon to save changes
in the layer. Next click on the pen to toggle off edit mode.

4 - Add variable colors to QGIS project properties


In this tutorial we’ll use project variables to set colors to save time in
configuring our elements. Then, if you change a variable, all elements (ex: polygon, text,
chart, svg…) will be update.
Now in menu select Project -> Properties

In variables click on “+” to add new variable


Now add variable name and value like this:

Repeat it to set all these variables:

color_1 #F20544

color_2 #4B83F2

color_3 #05F283

color_4 #FFC000

color_5 #C8C5D9

color_dark #131E40

Of course, you can use your own color palette

Don’t forget to regularly save your project


5 - Set symbology for layers
Double-click on municipalities and in symbology select categorized. Select
the field “EPCI” created previously for “value” and then click on classify.

You can remove the last category that contain elements with no values because our
expression should have set all values.

Here each municipality will take color depending on his EPCI name.

A default color palette will be set and we have now to set it with our colors.
Double-click on first category and select simple fill, then click on the button on the right of
the color, select variable and then color_1

Set stroke color to white and width to 0,46mm


Repeat for each other to get something like this

Now double-click on labels to set symbology. Choose “Single Symbol” and then
select “Single Marker”. Use white for “fill color” and set “Stroke color” to our
variable “color_dark”.

Now we will set label using background, round borders, callouts, shadows and some
positioning settings. There are so many options for labeling but we will see just a little
part.

Don’t forget to regularly save your project


Go to “label” just below symbology, select “Single Labels”, “name” as “Value” and
in
“Text” tab “8 points” for “Size” and set “color” to our variable “color_dark”

Next, on “Background” check “Draw background“, set “Size X” to 3 points, “X”


and “Y” “Radius” to 2 points and because of Poppins font gap set “Y” offset” to “1,5”
points. Then set the symbology of the shape under “Shape” by clicking on it.
In background symbol, select “Simple Fill”, white for “Fill color” and use our
“color_dark” variable for “Stroke color”

In “Shadow” “Offset” to “0” and “Opacity” to 20%.


In “Placement” select “Cartographic” mode and “Distance” to 4mm

And to finish in “Callouts”, check “Draw callouts”, “Offset from feature” to


“1,2” and click on “Line style”.

In “Callout Symbol” select “simple line” and set color to our variable
“color_dark”
You should now have a map like this.

6 - Create a composer with standard elements


Create a new print layout and name it as you like

In our print layout we will add first watermark text in background.


Add a new text box in the top of the page, in “Item Properties” add your text (here
‘POP’) and then click on “Font” under “Appearance” to get Font settings

The new panel is pretty similar to label panel. Set your font to a Black type if
possible, use an amazing size and chose a light color

For Poppins gap correction we should add

these values to get a good alignment but

this could be different with other fonts


You can copy & paste the text element, just change font size and bloc position.

You may have to change font, position and other parameters depending on the font you
choose. You can check lock elements to not be disturbed by these blocs later.

Add a map bloc and in item properties, uncheck “Background” to remove white
background
Add a legend bloc and name it as you like (but we always add legend ) and set
parameters on Item properties. Remove background like for map, uncheck “Auto update”
and customize on your need. For me remove “labels”, set fonts and rename
municipalities
Add a North arrow on the map, select you SVG images and set parameter as you like.
Here “Fill color” to “color_5” and “Stroke color” to “color_dark”

Add rectangle on the right and set his properties


You can set blending mode to “Multiply” to get better effect and set fill color
and stroke like below

7 - Add charts with expression for colors, text…


Add a first chart, remove background, set blending mode to “Multiply” and
click on “Setup Selected Plot”
Set the symbology like this, select “Bar Plot”, “municipalities” for “Layer”, link to
our map, check “Use only features visible in map”, select “EPCI” for “X Field”
and add to_real(“population”) to “Y Field” because our field type is actual
string (extracted from QuickOSM). Then click on “Update Plot”.

Now we will add color corresponding to map and using our variables. Click on the
button next to “Bar color” and select “Edit”
Add the expression below, it’s an expression to map a color to a specific
value of a
field
map_get(
map(
'CASUD',@color_1,
'CINOR',@color_2,
'CIREST',@color_3,
'CIVIS',@color_4,
'TCO',@color_5),"EPCI"
)
Add the same expression to “Stroke color” and update plot to get this

In the “Layout Options”, add these texts and set up your font with bigger sizes. Then
update the plot
For a second chart you can just copy & paste the first chart bloc. Then change
information corresponding to this, now we have density expression
to_real(“population”)/($area/1000). Change the title in “Layout Options” and
update plot

Add text with the text bloc and set the font size to correspond your needs.
We will alternate between different font size and font type to have some text that can be
aligned. For the next text we will use an expression to get population from the
“municipalities” layer with an aggregate function.

Use this expression to aggregate population after conversion to number.

aggregate( 'municipalities','sum',to_real("population"))/1000
I divided it by 1000 to use “K” unite, just add a “K” next the expression and set
your
font

Then use this expression to count municipalities

aggregate( 'municipalities','count',$id)
Adjust elements positions and add a title of your choice

Add svg images and use variables for colors


After adjustments of positioning, you can add some elements of your choice

Note: CREDITS

This map tutorial has been created with QGIS, QuickOSM, DataPlotty, Openstreetmap data
(…….)

Realized by (Write your name & Registration number here)


Of course, if you now change the colors from project variable, the print layout will take it
into account.

If you use this palette, you’ll see the difference

#10454F, #506266, #818274, #A3AB78, #BDE038

#0B47BF, #2953A6, #F29727, #F2762E, #F24141

Of course, you’ll have to choose colors depending on what you want to


show so be careful. A graduated color should be used with symbology
graduated for example graduate color by population value. But there are much
more steps to do it with our dataset. If you want to know how, just let me know…

You might also like