Exploring Italian vector data with QGIS
To start mapping with QGIS, we will explore the administrative limits of Italy.
The administrative areas are organized in three levels. We will open and explore the third level, the most detailed one.
- 1 Module data
- 2 Other source of global data
- 3 Introducing QGIS
- 3.1 Adding administrative limits data
- 3.2 Explore the interface
- 3.3 Explore the data
- 3.4 Managing the selection
- 3.5 Managing layers
- 3.6 Styling
- 3.7 Managing projects
The Administrative Divisions were downloaded from Global Administrative Areas.
You can download Italy Administrative divisions from GDA:
- Select Italy
- Select the Geopackage file format
Alternatively, you can downloaded a copy from http://mapmaking.info/images/files/ITA_adm_gpkg.zip.
We will play with the Administrative divisions of Italy.
After download the archive, go to the Downloads folder and extract the files there. We will use the extracted
Other source of global data
Start QGIS from the Geospatial menu, under Desktop GIS.
You will be presented with a random QGIS Tip. Get rid of the tips, by selecting the check box on the bottom of the dialog. You can activate the QGIS Tips again, going to Settings → Options → General.
Adding administrative limits data
To add the first data set to QGIS, drag and drop
CHN_adm.gpkg on top of QGIS (
CHN_adm.gpkg is locate in the
Downloads folder). Just drop it on top of QGIS.
A new dialog will open, so you can select which layers to add to QGIS. There are more than one layer available. Select them all.
The result will be a new map, with 4 layers.
Start by deselecting layers:
- CHN_adm CHN_adm0 any
- CHN_adm CHN_adm1 any
- CHN_adm CHN_adm2 any
Keep only the layer
ITA_adm ITA_adm3 selected. We will work with this layer.
Your polygons have a different color? Don't worry. The data set does not have any information about styling. QGIS uses a random color to fill the polygons in such case.
Explore the interface
Before any further exploration, it will be easier for us, to call the same name to each QGIS interface area.
Let's use the following terminology:
- Menu bar
- Toolbars (can be placed in different places)
- Layer panel
- Browser panel
- Map canvas
- Status bar
Toolbars also have names. The ones we need the most are:
|Map navigation toolbar|
|Manage Layers toolbar|
Note: Each panel or toolbar can be moved, activated or deactivated individually. But if you are completely lost and want to restore the original layout, close QGIS, and write on the Terminal Emulator:
rm -rf .config/QGIS .qgis2
Start QGIS again.
Zoom, in, zoom out, zoom to extend
Selecting and deselecting features
In GIS, each layer is composed by a set of features with common properties.
Some GIS operations are performed at the layer level, dealing with all features. But sometimes we just want to manipulate a subset of features. To accomplish this, we can create a set of selected features. Features can be added or removed from the selected set.
It is important to learn how to create and manage the selected set.
Explore the data
The layer as features, each with a geometry property (a polygon, in this case) and several additional attributes. When we used the Identify Tool, we could see each feature attributes.
Many operations are performed based on the attributes of each feature. Select Open Attribute Table from the context menu, on top of the layer name.
Instead of display all features, QGIS let you see only filtered features.
NAME_1 = giulia
The title bar provides valuable numbers:
Total features: 8100, filtered: 219, selected: 0.
Features can be selected in the table view.
First, filter features having NAME_1 = giulia
219 features will be displayed.
Order them by NAME_2.
Select those having NAME_2 = Trieste.
Explore the table view toolbar
Move selection to the top
Zoom to the selected features.
Managing the selection
Certain operations can be done with the selected elements.
Dissolve municipality limits
We want to create a new polygon of the Trieste province by dissolving the 6 municipalities of the Trieste province.
The 6 municipalities should be already selected.
Vector → Geoprocessing tools → Dissolve
Save it as
OK, than Close.
A new layer is displayed on the map canvas, and a new item is displayed on the layer panel, on top of
Saving the selection
We will need to work with the Wuhan districts, but not with all districts in China. Instead of working with all districts, we create a new shapefile with the only 5 districts we need in more advanced exercises.
Confirm that you still have the 5 districts of Wuhan area selected.
On the layer panel, over the
china-adm-3 layer, use the context menu to select "Save Selection As..."
One more entry is added to our layer list, on top of
We already have 3 layers. Layers can by grouped and ordered for better organization. The order is also important to define the rendering order.
Drag the china-adm-3 layer to the top, and see whats happen. The two other layers became invisible.
Create group layers
Use the contextual menu in the layer panel to "Add New Group". Change it's name from group1 to China.
Create another group. Call it Wuhan.
Drag the layers, to create the following hierarchy:
Wuhan wuhan-district wuhan China china-adm-3
Making beautiful maps is an art. Let's start by exploring some basic styling capabilities.
Change the style of the three layers.
- china-adm-3: use some sort of (pastel) green.
- wuhan: use a more vivid green
- wuhan-district: do not fill the polygons; select No Brush, in the Fill Style combobox.
- wuhan-district: in the labels panel, check 'Label this layer with' and select NAME_3 from the dropdown list.
Over the wuhan-district or wuhan layer, select Zoom to Layer Extent.
The resulting map should look like the following one.
Save the project, as qgisintro. Next time, we can reopen this project.