qgis essentials - download.astuntechnology.com · qgis can open excel files, but you can also use...

118
QGIS Essentials Antony Scott Astun Technology [email protected]

Upload: others

Post on 29-Oct-2019

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

QGIS Essentials

Antony ScottAstun [email protected]

Page 2: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

About the course

● Introductions● Housekeeping● Expectations● Schedule● Course Notes● Exercises

Page 3: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Schedule

1. Getting Started with QGIS

2. Working with Vector Data

3. Selecting and Querying Data

4. Styling

5. Web Services

6. Loading Raster Data

7. Data Capture and Editing

8. Vector Analysis

9. Print Composer

10.Databases

Page 4: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

Module 1: Getting Started with QGIS

Page 5: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Contents

● Introduction to QGIS

● Interface, including menus, settings and toolbars

● Managing layers

● QGIS Browser

● Projects

● Coordinate Reference Systems

● Plugins

Page 6: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Introduction to QGIS

● The leading open source desktop GIS

● Free and open source

● Official project of OSGeo (Open Source Geospatial Foundation)

● Supports a wide range of proprietary and open spatial formats

● Visualise, manage, edit, analyse, compose printable maps

● Uses plugin functionality as core component of architecture

● Runs on (pretty much) any platform – Windows, Mac, Linux

Page 7: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

QGIS Interface

Panels

Page 8: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Information Bar

Page 9: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Navigation Tool Bar

Can also use mouse wheel to zoom in and out

● These tools control what happens when you use the cursor

Page 10: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

QGIS Browser

Page 11: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Plugins

QGIS relies on plugins for its evolution – and the best become part of the product

Separate plugin

Part of core

Embedded plugin

Page 12: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Managing Plugins

Page 13: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Versions

● Current LTR: 2.18

● Next LTR: 3.2 (Summer 2018)

Page 14: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

QGIS Projects

● QGIS files are called projects - XML with a .qgs extension

● They contain:

– References to data

– Styles

– Print Composers (map layouts)

– Queries

● They don't contain:

– Data!

● Open a .qgs file (from the data folder) in a text editor and review

● Save often - there is no autosave (though there's a plugin...)

Page 15: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

QGIS Project File

Page 16: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Coordinate Reference Systems (CRS)

● We need a CRS to tell our GIS how to represent spherical (or Geoid) data on a flat plane...

Page 17: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

There are lots of map projections...

https://imgs.xkcd.com/comics/map_projections.png

Page 18: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

CRS in QGIS● All CRS have an SRID (Spatial

Reference System Identifier)

● QGIS uses the EPSG (European Petroleum Survey Group) SRID

● To remember:

– EPSG: 27700 – British National Grid

– EPSG: 4326 – WGS 84 (Lat/Lon)

– EPSG: 3857 – Web Mercator

Page 19: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Managing CRS

1. Set default CRS for new projects

2. Set default CRS for creating new layers

3. After that - QGIS will do the translation work for you

Page 20: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Exercise 11.1: Getting Started

Objective: Familiarisation

Page 21: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

Module 2: Working with Vector Data

Page 22: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Contents

● Types of data – vector, raster

● Vector data formats (e.g. MapInfo,ESRI shapefile, PostgreSQL, KML)

● Excel and CSV data

● Layer properties and attributes

● Joins

● Exporting

● Measuring

Page 23: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Vector and raster data

● Vector data has discrete features constructed from vertices

● Raster data is a digital image made up of pixels - the shapes represented don’t exist as separate objects.

Page 24: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Geometry Types of Vector Data

Line PolygonPoint

Page 25: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Vector formats

QGIS can read most GIS data, including over 20 vector formats:

● ESRI shapefile: default format

● Postgres/PostGIS: e.g. corporate data store

● MapInfo: only TAB editable

● AutoCAD: not editable

● CSV: with or without coords

● KML: Google Earth/Maps

Most functionality works with all formats

Page 26: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Shapefiles

● ESRI proprietary format – currently the de facto GIS data standard

● .shp extension – with additional files

● The default format for QGIS (but changing to GeoPackage in v 3.0...)

Page 27: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Loading a vector layer

● Click on the Add Vector Layer toolbar button

● Or type Ctrl-Shift-V.

● Or use the QGIS Browser

● Or browse to the file in Windows Explorer and drag and drop into QGIS

Page 28: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Attribute tables

● Every vector layer has an attribute table, holding the data behind the layer

● Each row in the table corresponds to a feature in the layer

● To see the attribute table, select the layer then Right-click > Open Attribute Table (or click the toolbar button)

Page 29: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Loading text files

● Any delimited text file (e.g. CSV) can be loaded into QGIS, whether it is spatial (vector) data or not

● QGIS can open Excel files, but you can also use CSV as an intermediate format

● When you open the a CSV file, you will see the dialogue on the next slide

● You can usually just accept the defaults, but you must specify the CRS if prompted

Page 30: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Loading delimited text

Page 31: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Joining data

● Joins are often needed to bring non-spatial (for example from CSV) data into a QGIS spatial layer

● This is equivalent to a database table join or view, or using VLOOKUP in Excel

● The target spatial layer and the source data layer (the join layer in QGIS) must have a data column containing the same data (Join field/target field)

Page 32: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Creating a join

● Select the target layer – where the data needs to go

● Properties > Joins > [Add join]

● Complete the dialogue below, matching the fields in the two tables

Page 33: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

QGIS as a translation hub

● QGIS will save and open pretty much anything (using ogr2ogr)

● This includes:

– CSV

– MapInfo

– KML

– GPX

– Shapefile

– Excel

● Right-click > Save As

Page 34: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Save options

When saving, you can:

● Save a selection: only save selected features

● Change CRS: convert to another CRS on save

● Add to map: see your saved file

● Save extent: crop the saved file to the current view

● Save symbology: include the symbology in the fileset

● Drop attributes: just save the spatial elements

Page 35: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Measuring

Measure a line or area directly in the map window

Page 36: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

The measuring tool

● For a quick measurement

– Use the measuring tool for areas and lengths

● To add areas/ lengths/ perimeters to the attribute table for all features

– Vector > Geometry Tools > Export/Add Geometry Columns

● For a statistical summary of a single field

– Vector > Analysis Tools > Basic Statistics

Page 37: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Exercise 11.2: Working with Vector Data

Objective: Learn loading, viewing and joining

Page 38: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

Module 3: Selecting and Querying Data

Page 39: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Selecting and Querying

● Toolbars

● Identify, Select, Query and Filter

● Attribute queries

● Spatial queries

Page 40: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Query and Selection Tools

● These tools control what happens when you use the cursor

Page 41: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Identify, Select and Filter

Action Why? What? How? Also...

Identify Show data (attribute values) for a feature

Click on feature

Can show form for editing

Select Create a subset of features (but show all)

Select manually (with mouse) or by query

Selected features are highlighted in map and attribute table

Filter Show a subset of features (and hide the rest)

Select by query

Layer > Filter Further selection can be made on subset

Page 42: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Identify

● Get information about a feature or small group of features

Use to:

Note that:

● This does not select or filter

Page 43: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Identify tool

The Identify tool is used to display the attributes and properties of map features

1. Select the layer of interest in the left-hand list

2. Select the tool and the cursor will turn into arrow with an ‘i’

3. Click on a map feature

Note that the 'Identify Results' panel may look different depending on your configuration

Page 44: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Identify – Multiple features

Page 45: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Identify – Derived data

On the third level of the identity tree you can see derived data – i.e. measurements

Page 46: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Select

Use to:

● Tag a feature or set of features for further action

Note that:● Selections remain in place until removed

● Selected features are highlighted in the map and the attribute table

● You can run a query to make a selection, or select manually

● Selections can be made in more than one layer

Page 47: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Selection ToolsThere are tools for selecting map features from the map in a drop-down list under Select

And tools for clearing a selection (left) and for selecting using an expression (right)

And tools for clearing a selection (left) and for selecting using an expression (right)

Page 48: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Select by Rectangle

● Clicking on a feature to select it

● Selecting this tool and drag a box over the features - any features that intersect the box will be selected

Page 49: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Polygon

Freehand

Select by Polygon or Freehand

Page 50: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Additional Select tools

● Having selected a feature there are two ways to navigate to it:

– Pan to selection centres the map on the feature

– Zoom to selection sets the map extents to that of the feature.

● You can also remove all the selections

– Remove selections

Page 51: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Filter

Use to:

● Only show a subset of features

Note that:

● Attribute table and map may be out of sync

● Map (menu) filter and Attribute Table filter are different

Page 52: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Filter map from menu

● Right-click > Filter

● Write query

● Only features returned by query are shown on map and attribute table

Page 53: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Filter from attribute table

● From attribute table, Advanced Filter

● Write query and apply

● Filtered rows are shown in attribute table, but all features are shown on map

Page 54: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Spatial queries

● Spatial queries allow you to select features based on where they are and how they interact with other features, e.g.:

– Points inside a polygon

– Lines which cross other lines

● If you don't already have the Spatial Query plugin installed, enable it in the Plugins Manager

● Use this dialogue to create a spatial relationship between two spatial layers, resulting in a new selection

Page 55: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Spatial query example

● Select all the settlements which fall inside the parish which is already selected

● Create a new selection with the result

Page 56: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

The expression builder

Page 57: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Query tips

● Use the query builder tool to put together a query step by step

● Use IS NULL or ='' to look for blank values

● Use AND to link query clauses together

● Use single quotes around text strings like 'this'

● Use % as a wild card

● Use ILIKE to match text (case-insensitive)

● Use the help window in the query builder for more tips

Page 58: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Exercise 11.3: Selecting and Querying

Objectives: Understand select, query, filter; learn some queries

Page 59: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

Module 4. Styling

Page 60: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

What is styling?

+

=

Page 61: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

What are styles?

Styles are the rules which determine how data is visualised

● They can be fixed

– colour all polygons red

● Or driven by the data

– Set polygon colours according to population

● One layer = one style(but you can always copy a layer)

Page 62: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Types of styles

● Single symbol

● Categorised

● Graduated

Page 63: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

OpenStreetMap styling

Page 64: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Styles can have many components

Component 1

Component 2Result

Page 65: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Style toolsTo make a style, you can combine:

● Symbols

● Colours

● Fills

Page 66: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Style optionsYou can choose:

● Single Symbol

– Every feature is treated the same

● Categorised styles

– One setting for each unique attribute value

● Graduated styles

– Based on bandings of a numeric attribute value

● Rule-based styles

– Driven by user-defined rules

Page 67: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Labelling – the dark art of GIS

● Use the labels tab on the properties dialogue to set a label for a layer

● Label content can be an attribute value, or the result of an expression

● Good placement is difficult, and gets more difficult if you add more layers

● If automatic labelling is not working for you – try annotations

Page 68: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Managing Styles

● Export/Import in QML: allows sharing within QGIS

● Copy/paste: between layers

● Save to database: as a stored and shared resource

● Set as default: to be applied whenever the layer is opened

● Saved with a shapefile (like a LYR file): so the style stays with the data

● Export/Import in SLD: for use in other programmes (e.g. GeoServer, iShare)

*SLD – Styled Layer Descriptor

Page 69: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Annotations

● Use annotations to add labels to maps which are independent of the data – but not of the map

● Symbols, text, background and frame can be styled

● Point marker is geo-located

Page 70: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Exercise 11.4: Styling

Objective: Practice styling

Page 71: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

Module 5: Web Services

Page 72: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Contents

● What are web services?

● Web Map Service (WMS)

● Web Feature Service (WFS)

● Saving and sharing service connection settings

Page 73: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Web Services

● Web Map Service (WMS) is a protocol for serving map images over the Internet. These can be generated by a map server tools such as GeoServer and MapServer. WMS can be considered as Internet-sourced raster data.

● Web Feature Service (WFS) is a protocol for requesting and providing data on geographical features over the Internet. WFS is Internet-sourced vector data. WFS features can be selected, queried and copied like any other vector layer.

● In both cases:

– A URL is needed to reference the service

– Authentication may be needed

– The service is XML-based, and platform-independent

Page 74: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Getting WMS layers

1. Connect to end-point 2. Get catalogue(GetCapabilities)

Page 75: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Exercise 11.5: Web Services

Objective: Load and use web services

Page 76: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

Module 6: Loading Raster Data

Page 77: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Raster Layers

● Introduction to raster data

● Georeference files

● Adding raster Files

● Creating a virtual raster

Page 78: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Vector and raster data (reminder)

● Vector data has discrete features constructed from vertices

● Raster data is a digital image made up of pixels - the shapes represented don’t exist as separate objects.

Page 79: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

GeoReference files

● Some image files come with embedded spatial information so the GIS knows where to put the image on the map – e.g. ECW, GeoTIFF

● Others require associated georeference files. These have the same name as the image file, are in the same folder, and normally have extensions:

– TFW format (ESRI World file)

– TAB (MapInfo file)

● Both formats are supplied with Ordnance Survey tiled raster data files

● Other image suppliers may provide similar files

Page 80: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Pyramids

● Pyramids speed up the display of raster data by retrieving only the data at a specified resolution that is required for the display

● A lower-resolution copy of the data displays quickly when drawing the entire dataset.

● As you zoom in, levels with finer resolutions are drawn.

Page 81: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Virtual Rasters

● Raster images can be loaded individually – however this can be laborious if there are lots of them

● QGIS provides a means of loading all the images from a folder at once, stitching them together in a single layer

● This is a Virtual Raster

Page 82: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Virtual Raster dialogue

Page 83: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Exercise 11.6: Loading Rasters

Objective: Learn raster loading and managing techniques

Page 84: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

Module 7: Data Capture and Editing

Page 85: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Editing tasks

● Create a new layer

● Modify a layer

● Add features (points, lines, polygons)

● Move features

● Edit nodes

● Edit data

Page 86: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Digitising toolbar

Page 87: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Editing existing data

1.Select a layer

2.Click the edit button to enable editing

3.Add, modify or delete features and/or

4.Edit attribute values

5.Save changes

6.Click the edit button to disable editing

Notice that the editing toolbar changes according to the geometry type of the data

Page 88: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Creating new data

1.Create a layer – normally a shapefile

2.Select the geometry type

3.Create attributes

4.Click the edit button to enable editing

5.Add features

6.Save changes

7.Click the edit button to disable editing

Page 89: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Attribute Editing and the Field Calculator

Page 90: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Snapping● Snapping helps to digitise based on existing vector data

● Settings > Options > Digitizing > Snapping

Page 91: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Advanced Digitising (Edit Menu)

● Undo

● Rotate Feature(s)

● Add Ring

● Fill Ring

● Delete Part

● Offset Curve

● Split Parts

● Merge Attributes of selected features

● Redo

● Simplify Feature

● Add Part

● Delete Ring

● Reshape Features

● Split Features

● Merge Selected Features

● Rotate Point Symbol

Page 92: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Productivity tools

● Reshape features

– change the geometry of existing shape by extending the shape

● Add Part

– add a new shape to an object in a multi-geometry

● Add ring

– add a new shape inside a polygon geometry to create a hole

Page 93: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Reshape tool

Right click to finishLeft Click for nodes

Page 94: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Page 95: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Page 96: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Page 97: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Line Features

Page 98: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Exercise 12.7: Data Editing

Objective: Become confident in basic editing

Page 99: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

Module 8: Vector Analysis

Page 100: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Analysis examples

● Buffers

● Intersect

● Difference

Page 101: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Buffers

Page 102: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Buffer options

Page 103: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Intersect

Page 104: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Intersect options

Page 105: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Difference

Page 106: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Difference options

Page 107: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Exercise 12.8: Vector Analysis

Page 108: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

Module 9: Print Composer

Page 109: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Building a Print Composer

● Create a new print composer

● Set paper and quality

● Set snapping

● Add a map

● Set map properties (Grid, extents)

● Add map Furniture

● Create an inset map

● Print

● Save

● Create a template

Page 110: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Print Composer layout

Page 111: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Exercise 12.9: Print Composer

Page 112: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

Module 10: Working with Databases

Page 113: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Loading PostgreSQL/PostGIS data● PostgreSQL: open source database

● PostGIS: extension functions to spatially enable

● Supports spatial indexing, filtering and query

● Connect to the database, then load a table

● Holds spatial and non-spatial tables

● PgAdmin: admin UI for Postgres

Page 114: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Connecting to Postgres

Server

Check for non-spatial tables

Page 115: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Saving to Postgres● QGIS and Postgres/PostGIS work seamlessly together

● Use the Browser and the DB Manager to manage migration between your Postgres and file-based layers

Page 116: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Postgres Parameters

Page 117: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Exercise 12.10: Working with PostGIS

● Load data from Postgres

● Save data to Postgres

● Save a style to Postgres

● Use PgAdmin to view/query the data you saved

Page 118: QGIS Essentials - download.astuntechnology.com · QGIS can open Excel files, but you can also use CSV as an intermediate format When you open the a CSV file, you will see the dialogue

www.astuntechnology.com

Finally...● QGIS site:

– https://www.qgis.org/en/site/index.html

● Mailing lists:

– https://www.qgis.org/en/site/getinvolved/mailinglists.html

● UK QGIS User Group (Google+):

– https://plus.google.com/u/0/communities/113949150549951715823

● Anita Graser

– https://anitagraser.com/

● Alisdair Rae

– http://www.undertheraedar.com/

● Nathan Woodrow

– https://nathanw.net/