You are on page 1of 20

1

WORKSHOP1 QGIS : Making a Map

BY

HEDIA CHAKROUN

2GC

---------------------------------------------------------------

Software installation

1. From the web site http://www.qgis.org/en/site/forusers/download.html , go to “download Latest release (eg. for New
Users): and download QGIS Standalone Installer Version 2.18 (64 bitd)
2. Run QGIS2.18 : Open QGIS Desktop

---------------------------------------------------------------

WARNING :

This workshop has been adapted by H. Chakroun from “making_a_map_letter” by Ghandi http://google.com/+UjavalGandhi http.

Overview of “WORKSHOP1”

Often one needs to create a map that can be printed or published. QGIS has a powerful

tool called “Print Composer” that allows you to take your GIS layers and package them to

create maps. This workshop shows how to create a map of Tunisia with standard map elements like north arrow, scale bar,

legend and labels.

A. Open and explore an existing project


We will use the data embedded in the project TUNISIA.QGS

1. Open QGIS. Click on Project  Open.


2. Browse to the project : /2016_TP_QGIS/UNISIA_DATA/ TUNISIA.QGS . This is the project file that contains a styled layer
in QGIS Document format. Click Open.
3. You would see one layer in the table of content named “layers” and a styled map of Tunisia in the QGIS canvas. If you see
errors displayed at the top of the canvas, click on the cross to close it.

TP QGIS
HEDIA CHAKROUN, ENIT
2

4. Before we make a map suitable for printing, we need to choose an appropriate projection. This dataset comes in Universal
Transverse Mercator (UTM) Coordinate System Zone 32, the Datum is CARTHAGE.
5. Explore zoom shortcuts to zoom in and out

B. Set the projected reference system of the map

1. Project  Project Properties


If the projection system is not displayed within the “Recently used coordinate reference systems”, add it from the

“Coordinate Reference System of the World”.

2. Put the cursor on “Ariana” and check the value of its projected coordnates

TP QGIS
HEDIA CHAKROUN, ENIT
3

C. Create a “map composition” of Tunisia

1. Once you are centered around the area of interest, click on the “New Print Composer”
button. It is also accessible by Project  New Print Composer.

2. You will be prompted to enter a title for the composer. Enter “Tunisa_Map_Your_Name” and click Ok.

3. In the Print Composer window, click on Zoom full to display the full extent of the
Layout.

TP QGIS
HEDIA CHAKROUN, ENIT
4

4. Now we would have to bring the map view that we see in the QGIS Canvas to this
layer. Click on Layout  Add Map. Once the Add Map button is active, hold the left mouse button and drag a rectangle

where you want to insert the map.

5. The rendered map may not be covering the full extent of our interest area. Click on Layout  Move content (or the Move
item content button) to pan the map in the window and center it in the
composer.

6. Now, adjust the zoom level for the given map. Click on the Item Properties tab and
enter 4000000 for Scale value. Your map should look like this :

TP QGIS
HEDIA CHAKROUN, ENIT
5

7. Now move the left cursor down to reach the “Grid” button to specify the grid equidistance and the coordinates. Press
“Font button” to change the police of coordinates.
8.

TP QGIS
HEDIA CHAKROUN, ENIT
6

9. In the item properties button, specify the grid equidistance and the coordinates. Press “Font button to change the police
of coordinates. Explore the other buttons : Fonts and colors, Position and size, etc.

TP QGIS
HEDIA CHAKROUN, ENIT
7

10. Add a scale bar : Layout  Add scale bar : put the cursor on the map composition for the localtion of the scale bar

Now we will add a North Arrow to the map. Print Composer comes with a nice

collection of map-related images - including many types of North Arrows. Click

Layout ‣ Add Image.

11. Write a title of the map : Click on Layout  Add Label. Click on the map and draw a box where the label should be. In the
Item Properties, tab, expand the Label section and enter the text as shown below.

TP QGIS
HEDIA CHAKROUN, ENIT
8

TP QGIS
HEDIA CHAKROUN, ENIT
9

12. Add a north arrow : Holding your left mouse button, draw a rectangle on the top-right corner of the map canvas. On the
right-hand panel, click on the Item Properties tab and expand the Search directories section and select the North Arrow
image of your liking.

13. The final map should look like this :

TP QGIS
HEDIA CHAKROUN, ENIT
10

TP QGIS
HEDIA CHAKROUN, ENIT
11

WORKSHOP2 QGIS : Working with Attributes

BY

HEDIA CHAKROUN

2GC

---------------------------------------------------------------

WARNING :

This workshop has been adapted by H. Chakroun from “Working with Attributes” by Ghandi http://google.com/+UjavalGandhi http.

Overview of “WORKSHOP2”

GIS data has two parts : Features and Attributes. Attributes are structured data about

each feature. This tutorial shows how to view the attributes and do basic queries on

them in QGIS.

A. Get the data

We will use free data of the “Populated Places” dataset from Natural Earth site : .

1. Open QGIS.
2. Layer  Add Layer  Add vector layer : Browse to /2016_TP_QGIS/WORLD_DATA/ne_10m_populated_places.shp
3. Choose the WGS 84 Coordinate Reference System as shown below.

TP QGIS
HEDIA CHAKROUN, ENIT
12

We will use free data of the “Populated Places” dataset from Natural Earth site : .

The selected layer will now be loaded in QGIS and you will see many points representing the populated places of the world. Your

screen should look like this :

B. Explore the attributes


1. To see the attributes corresponding to the points of populated places of the world : Right-click the layer and select Open
Attribute Table.

TP QGIS
HEDIA CHAKROUN, ENIT
13

2. Explore the various attributes and their values

3. We are interested in the population of each feature, so pop_max is the field we are looking for. You can click twice on the
field header to sort the column in descending order. Note that Tokyo is the most populated place with 35676000
habitants.

C. Queries on the attributes

TP QGIS
HEDIA CHAKROUN, ENIT
14

1. Now we are ready to perform our query on these attributes. Select features using
an expression

2. In the Select By Expression window, go to “Function” and expand the “Fields and Values” section

3. Double-click the “pop_max” label. You will notice that it is added to the expression
section at the bottom. If you aren't sure about the field values, you can click the Load all unique values to see what the attribute

values are present in the dataset. For this exercise, we are looking to find all features that have a population greater than 1,000,000.

So complete the expression as "pop_max" > 1000000 and click Select.

TP QGIS
HEDIA CHAKROUN, ENIT
15

4. Click on Close and return to the main QGIS window. You will notice that a subset of points is now rendered in yellow. This is
the result of our query and you are seeing all places from the dataset that have the pop_max attribute value greater than
1,000,000.

5. The goal for this exercise is to find the places that are country capitals. Let’s refine our query to select only those places which
are capitals. Click on the Select feature using an expression button in the attribute table. The field containing this data is
adm0cap. The value 1 indicates that the place is a capital. Enter the expression as "adm0cap" = 1. Since we want to search only
within our previous query results, select Select within selection.

TP QGIS
HEDIA CHAKROUN, ENIT
16

6. Click on Close and return to the main QGIS window. Now you will see a smaller subset of the points selected. This is the result
of the second query and shows all places from the dataset that are country capitals as well as have population greater than
1,000,000

TP QGIS
HEDIA CHAKROUN, ENIT
17

Let's save these results to a separate layer : Right-click on the layer and select Save Selection As. Click on “Save only selected

features”. Keep the format selection as ESRI Shapefile and enter the output name as large_capital_cities_your_name. Check the box

next to Add saved file to map and click OK.

TP QGIS
HEDIA CHAKROUN, ENIT
18

7. The newly created shapefile will be automatically loaded into QGIS. Turn off the populated places layer by un-checking
the box next to it. Now, you will see only
the features from the newly created layer containing capital cities of the world that

have population greater than 1,000,000.

D. Customize a map with labels

1. Double click the as large_capital_cities_your_name layer in the map legend to open the Properties dialog.
2. Click on the Style tab and select a blue as fill color.
3. Click on the Labels tab and check the Label this layer with checkbox to enable labeling. Choose the “ADM1NAME” to
display the capital names of the largest cities in the world

TP QGIS
HEDIA CHAKROUN, ENIT
19

4. Click [Apply] and finally click [OK]. The result should look like this

TP QGIS
HEDIA CHAKROUN, ENIT
20

WORKSHOP_EVALUATION QGIS

BY HEDIA CHAKROUN

2GC

Overview of “WORKSHOP_EVALUATION”
You have to choose a lesson from the tutorial site and follow the stages to make an
application in QGIS of your choice.
The tutorial site is : http://www.qgistutorials.com/en/
You have to choose one application from he following list (Basics GIS operations &
Intermediate GIS operations)

Binome 1: Basic Vector Styling + Raster Mosaicing and Clipping

Binome 2: Calculating Line Lengths and Statistics + Working with Terrain Data

Binome 3: Performing Table Joins + Raster Mosaicing and Clipping

Binome 4: Calculating Line Lengths and Statistics + Georeferencing Topo Sheets and Scanned Maps

Binome 5: Working with Projections+ Working with Terrain Data

Binome 6: Performing Spatial Joins + Georeferencing Topo Sheets and Scanned Maps

Binome 7: Digitizing Map Data + Raster Mosaicing and Clipping

Binome 8: Digitizing Map Data + Basic Raster Styling and Analysis

Binome 8: Digitizing Map Data + Georeferencing Topo Sheets and Scanned Maps

Binome 9: Working with Projections + Basic Raster Styling and Analysis

Binome 10: Performing Spatial Queries + Basic Raster Styling and Analysis

Binome 11: Working with Projections + Georeferencing Topo Sheets and Scanned Maps

Binome 12: Performing Spatial Joins + Working with Terrain Data

Binome 13: Performing Table Joinss + Georeferencing Topo Sheets and Scanned Maps

Binome 14: Working with Projections + Working with Terrain Data

The evaluation is as follows:

Downloading and Data integration in QGIS : 5/20

Executing Tutorial stages: 10/20

Interpretation and comments: 5/20

TP QGIS
HEDIA CHAKROUN, ENIT

You might also like