Practice1 QGIS1 Visualization
Practice1 QGIS1 Visualization
• About QGIS
• QGIS introduction
• Data formats
• Managing data
• Layers properties
• Vector visualization
• Raster visualization
• Printing maps
2
-About QGIS-
3
QGIS Software
QGIS (formerly Quantum GIS) was created in 2002 as a simple GIS viewer and has then evolved
into the leading Free and Open Source (Desktop) Software for Geospatial (FOSS4G) packages.
The latest release (July 2021) is 3.20.
Long Term Release (LTR) is 3.16 (these slides refer to QGIS 3.16 'Hannover')
QGIS is a project of the Open Source Geospatial Foundation (OSGeo)
• It runs on GNU/Linux, Unix, Mac OSX, MS Windows and Android
• It is licensed under the GNU General Public License (GPL)
• It supports vector, raster and database formats, including ESRI shapefiles
• Spatial data in PostgreSQL/PostGIS, GRASS vectors and rasters, or GeoTiff
• Maps can be compiled for printing using the print composer
Users can add customized plugins and GIS-enabled applications using Python or C++.
QGIS provides Server & Web Client capabilities to publish on the Web QGIS projects and layers
as OGC compatible WMS and WFS services.
https://www.qgis.org/en/docs
https://qgis.org/it/site/getinvolved/development/plugindevelopment.html
QGIS as a part of OSGeo
-QGIS introduction-
6
QGIS main graphical user interface
7
Display/hide panels and toolbars
8
Project properties
9
QGIS settings
10
-Data formats-
11
Data formats - Geopackage
Optional files
* .prj — projection format; the coordinate system and projection information, a plain text file describing the
projection using well-known text format
* .sbn & .sbx — a spatial index of the features
* .fbn & .fbx — a spatial index of the features for shapefiles that are read-only
* .ain & .aih — an attribute index of the active fields in a table or a theme's attribute table
* .ixs — a geocoding index for read-write shapefiles
* .mxs — a geocoding index for read-write shapefiles (ODB format)
* .atx — an attribute index for the .dbf file in the form of shapefile.columnname.atx (ArcGIS 8 and later)
* .shp.xml — metadata in XML format
Data formats - Geopackage
ShapeFile GeoPackage
Advantages: Advantages:
17
Load data from GeoPackage
18
Content of GIS4Schools_GeoPackage.gpkg
19
Load data from GeoPackage
20
Content of the Population_municipalities_on_lakes.shp:
21
Load vector files - shapefiles
22
Load raster files – GeoTIF files
23
Add a new layer to GeoPackage
24
Add a new layer to GeoPackage
25
Remove layer from QGIS
Since Population_municipalities_on_lakes l
ayer will not be used we will remove it
from QGIS, but also from GeoPackage.
26
Remove layer from GeoPackage
To
remove Population_municipalities_on_la
kes from GeoPackage right-click on the
layer in the Browser panel
(e.g. Population_municipalities_on_lakes)
and select Delete Layer (2). Then
in Delete Layer window we confirm
that we want to delete a layer (3) and
to compact (4) GeoPackage database.
27
-Layers properties-
28
Access to layer properties
29
-Vector visualization-
30
Vector examples
31
Optimal order of layers
32
Access to visual properties of a layer
33
Access to visual properties of a layer
Alternatively, it is possible to
activate Layer Styling Panel. It is
done from the View menu (1) →
Panels (2) by ticking the box next
to Layer Styling Panel (3).
34
Types of vector symbols
35
Single symbol style
36
Single symbol style
37
Categorized symbol style
38
Categorized symbol style
39
Vector feature labels
41
Graduated symbol style
42
Graduated symbol style
43
Saving style
44
Saving style
The other two Save style options - QML and SLD - create a separate style files (Fig. 1.8.5.2). QML (1) is
an XML format suited to store styles that QGIS can support. To save a style in this format it is necessary to
specify the File path and name (2). It is the only style that allows selecting specific Categories of style to be
saved (3). SLD (4) (Styled Layer Descriptor) is an XML schema for the styling map layers. It is not suited only
for QGIS, but also for other GIS softwares. To save style as SLD file, specify File path and name (5).
45
Loading style
46
Save QGIS project
47
-Raster visualization-
48
Raster examples
Add these layers as shown in Slide 13, and remove previous vector layers as shown in Slide 19.
49
Raster render types
50
Singleband gray render type
51
Singleband-Pseudocolor render type
52
Singleband-Pseudocolor render type
53
Paletted/Unique rendering type
54
Paletted/Unique rendering type
55
-Printing maps-
56
Rasters and vectors for map printing example
The following exercise will focus on creating an effective map layout, with the basic elements that a map should
contain as the legend, the title, the scalebar, etc.
The map to be composed, representing the water surface temperature distribution on Northern Italian insubric
lakes, will contain the following data:
•Raster data:
•Temperature_distribution
•Vector data:
•River_network
•Municipalities_OSM
These listed layers must be loaded and activated (ticked) in your Layers Panel. Add these layers as shown in Slide
13, and remove other layers as shown in Slide 19.
Be careful also to respect this order of listing to see Temperature_distribution layer on the top of the other ones.
57
Create New Print Layout
58
Compose a map – Add a map
59
Compose a map – Add a title
60
Compose a map – Add a legend
61
Compose a map – Add a legend
In the Item Properties box, you can name the item (1). Then you can focus on legend items:
when you add a legend to the map, its different items are represented by default, in the same
way they are represented in your QGIS Layers Panel. Therefore, before printing the map, it is
usual to change some names, labels or order to make them more understandable. Here, there
are two ways: one can make edits directly from QGIS Layer Panels, by modifying the style of
layers, or one can also choose to modify them just on the Map Print Layout, leaving the
Layers style as it is on QGIS. To apply the second option, it is necessary to uncheck the Auto
update box (2) into the Item Properties Panel. In the Legend items box now it is possible to:
• Reposition the single layers into the Legend, by clicking on the two arrows (3) below the
box.
• Add or remove layers, that are not visible on the map, from the legend (by clicking on + or
– (4)
• Change one layer’s name, by double-clicking on the layer’s name, typing a new name and
clicking on OK. Here, for example, try to change Temperature_distribution into a clearer
‘Water Temperature Distribution’ (5) as well as Municipalities_OSM into ‘Municipalities
borders’.
• Change the number of decimal digits of temperature values. To do so, click on each
numerical label (6) in the Legend items box and then remove the unnecessary digits,
clicking then on OK.
Finally, from Fonts and Text Formatting box (7), try to change also the font used for the
different items in the legend: remember it should be visible but not too huge.
62
Compose a map – Add a scalebar
63
Compose a map – North arrow
64
Compose a map – Save map
65
Compose a map – Save map
66
Exercise
• Create map layout with all elements (map name, legend, north arrow, scale bar) for the following layers:
• Display raster of temperature (Temperature distribution) so that it has 10 classes formed with quantile mode. Use Inferno
color ramp.
• Display every river (River network) that comes from different source with different color
• Display municipalities (Municipalities_OSM) in green fill with light green outline
• Assign lables to municipalities. The label should be a name of the municipality
• Create map layout with all elements (map name, legend, north arrow, scale bar) for the following layers:
• Display lake temperature (Temperature) with 20 equal interval classes and BuRd color ramp. (Hint → BuRd color ramp is
not available. Select RdBu and invert it from color ramp drop-down menu)
• Display land cover (Land cover) so that each value of a raster has different color. Use random color ramp.
67
Exercise - result
68
This presentation contains partially adapted content of GIS4Schools created by M. A. Brovelli, D. Carrion, M.
Gianinetto, D. Oxoli, L. G. A. Biagi, C. A. Biraghi, , G. Bratic, C. Gerosa, F. N. Polinelli, J. F. Toro Herrera, A.
Vavassori, L. Amici(© Copyright 2021, GEOLab). It is licensed under CC BY-NC-SA 3.0.