Procedure For Map Making With QGIs
Procedure For Map Making With QGIs
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.
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
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 ( 'La Possession' , 'Le Port' , 'Les Trois-Bassins' , 'Saint-Leu' , 'Saint-
Paul' ) THEN 'TCO'
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.
color_1 #F20544
color_2 #4B83F2
color_3 #05F283
color_4 #FFC000
color_5 #C8C5D9
color_dark #131E40
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
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.
In “Callout Symbol” select “simple line” and set color to our variable
“color_dark”
You should now have a map like this.
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
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”
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.
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
aggregate( 'municipalities','count',$id)
Adjust elements positions and add a title of your choice
Note: CREDITS
This map tutorial has been created with QGIS, QuickOSM, DataPlotty, Openstreetmap data
(…….)