introduction to qgis table of contents

18
Air Photo Services Training Days 18-19 th Dec 2014 Introduction to QGIS Table of Contents Aims.................................................................................................................................................................. 2 How to use this booklet.................................................................................................................................... 2 Task 1 - Setting Up Your QGIS Project............................................................................................................... 3 Task 2 – Opening raster files in QGIS and editing their properties .................................................................... 5 Task 3 – Add a Web-based Mapping Layer...................................................................................................... 11 Task 4 – Georeferencing.................................................................................................................................. 13 Course Materials designed by Rebecca Bennett, December 2014 Please use freely for your own information and the instruction of others but recognise the rights of the author to be acknowledged if the material contained is disseminated. Intro to QGIS – Getting Started 1

Upload: others

Post on 16-Apr-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to QGIS Table of Contents

Air Photo Services Training Days 18-19th Dec 2014

Introduction to QGIS

Table of ContentsAims..................................................................................................................................................................2How to use this booklet....................................................................................................................................2Task 1 - Setting Up Your QGIS Project...............................................................................................................3Task 2 – Opening raster files in QGIS and editing their properties....................................................................5Task 3 – Add a Web-based Mapping Layer......................................................................................................11Task 4 – Georeferencing..................................................................................................................................13

Course Materials designed by Rebecca Bennett, December 2014Please use freely for your own information and the instruction of others but recognise the rights of the

author to be acknowledged if the material contained is disseminated.

Intro to QGIS – Getting Started 1

Page 2: Introduction to QGIS Table of Contents

Air Photo Services Training Days 18-19th Dec 2014

Aims

The aim of this workshop is familiarise yourself with QGIS. In this session you will undertake the following tasks:

• Set up a GIS project• Navigate in the GIS• import and view an aerial photograph• import and view a Digital Terrain Model (DTM)• edit the properties of a raster• Add OS maps and open aerial data such as Google and Bing imagery

Each of these tasks stand alone as useful GIS tools but together they provide a workflow for working with airborne and map data.

How to use this booklet

Illustrations in this booklet show the icons on screen for each task. The full menu options are notated as follows: File > Open.Remember to save your project frequently as you work to get into good habits!

Intro to QGIS – Getting Started 2

Page 3: Introduction to QGIS Table of Contents

Air Photo Services Training Days 18-19th Dec 2014

Task 1 - Setting Up Your QGIS Project1. Start QGIS. Familiarise yourself with the layout of the screen. The QGIS interface is split into three areas:

Tool Bar at the top, Layer Menu to the left and Map Window to the right.

2. Some of the toolbars at the top of the screen may be compressed. To expand them click on the double arrow

To move the toolbars so that all the icons are visible use the vertical dotted line to the left of each toolbar. Hover your mouse over this line to get cross-hairs then click and drag to move the menu to another part of the screen. To find out the purpose of any icon hover your mouse over it.Below are the key toolbars for this session – you should check that all these are visible.

Navigation toolbar (pan, zoom)

Add data toolbar

Intro to QGIS – Getting Started 3

Page 4: Introduction to QGIS Table of Contents

Air Photo Services Training Days 18-19th Dec 2014

3. When you are happy that you can see all the icons in the toolbars your first task will be to set the project properties and save the project. From the Project menu select Project Properties.

4. To set the coordinate reference system (CRS) click on the CRS tab. Check the box beside “Enable on the fly CRS transformation”. The data for this tutorial is from the UK so we will search through the list for OSGB 1936. A quick way to do this is to type in the EPSG ID code 27700 and the list will filter to show the correct. NB there are a number of geographical and projected systems with OSGB in the name, make sure you get the projected system ESPG 27700 rather than any other!Click apply to set the CRS.

5. Click OK to close Project Properties and return to the main screen.6. Use File> save to save the project to your working area.

Intro to QGIS – Getting Started 4

Page 5: Introduction to QGIS Table of Contents

Air Photo Services Training Days 18-19th Dec 2014

Task 2 – Opening raster files in QGIS and editing their properties1. First we will open four aerial photographs (AP) of the study area using the tool bar icon (layer > add

raster layer).

You can hold down the shift or ctrl keys to select multiple files, and filter by file type in the lower right corner. Select the following aerial photographs.

PGA_SU1752_2008-04-26.jpeg, PGA_SU1753_2008-04-26.jpg, PGA_SU1852_2008-04-26.jpg, PGA_SU1853_2008-04-26.jpg

2. The importer will ask you to define the CRS for each file, check that it is ESPG 27700 (OSGB 1936 / British National Grid) and click OK.

Intro to QGIS – Getting Started 5

Page 6: Introduction to QGIS Table of Contents

Air Photo Services Training Days 18-19th Dec 2014

3. The AP files will appear in the layer manager on the left of the QGIS window. You can switch the layers onand off by using the check box beside the layer name.

4. Hovering you mouse over the layer will display the file path of the layer.

5. Practice using the pan and zoom tools to navigate round your rasters

6. Next we will add an OS 1:25OOO raster map also using the add raster menu. Pick the raster SU15 from the OS folder.

7.

8. The order of layers can be changed by dragging the layer up or down the layer menu. Practice moving theAP layers to the top above the OS layers.

Intro to QGIS – Getting Started 6

Click layer and drag up or down the list

Page 7: Introduction to QGIS Table of Contents

Air Photo Services Training Days 18-19th Dec 2014

9. We can alter the transparency of any of the rasters by right clicking on the raster's name in the layer menu and selecting properties. Use the Apply button to test the transparency before setting it. If you would always like the raster to default to this transparency setting, you can use the Save as Default button. When you are happy with the transparency click OK

10. Finally we will open a digital terrain model also using the add raster menu. Pick the Digital Surface Model lidar_DTM.asc

11. To improve the lidar raster display we will now edit the raster properties. In the menu bar, right click on the raster's name and select properties.

Intro to QGIS – Getting Started 7

Page 8: Introduction to QGIS Table of Contents

Air Photo Services Training Days 18-19th Dec 2014

12. Click on the style tab on the left menu.Edit the symbology so that the image is stretched to min and max values. This preference can be saved as the default for the file. NB – if you change the min / max values you must click “load” to action the changes before clicking OK.

Intro to QGIS – Getting Started 8

Page 9: Introduction to QGIS Table of Contents

Air Photo Services Training Days 18-19th Dec 2014

13. The lidar raster display should now resemble the image below.

14. Return to the properties menu. In this menu can be found a variety of options for colouring the map, editing transparency and viewing metadata.

Intro to QGIS – Getting Started 9

Page 10: Introduction to QGIS Table of Contents

Air Photo Services Training Days 18-19th Dec 2014

Take some time to familiarise yourself with these options:

• Change the raster from greyscale to Pseudocolour , pick render type “singleband pseudocolor” thenclick“classify” then OK

15. Use File> save to save the project to your working area.

Intro to QGIS – Getting Started 10

Page 11: Introduction to QGIS Table of Contents

Air Photo Services Training Days 18-19th Dec 2014

Task 3 – Add a Web-based Mapping Layer1. To add an OpenStreetMap or Google layer we will need to add another plugin to QGIS. Go to

Plugins> Fetch Python Plugins. In the search box type openlayers. Select the openlayers plugin and click install.

2. In the Web tab check the box beside the Openlayers Overview. In the bottom left of the screen there will now be an Openlayers Overview.

3. Check the “Enable” box and choose Google Satellite from the drop down menu. You will see it appears in the overview.

Intro to QGIS – Getting Started 11

Page 12: Introduction to QGIS Table of Contents

Air Photo Services Training Days 18-19th Dec 2014

4. To add the layer to your map window use the add raster button in the openlayers overview

5. Experiment with adding different layers – what happened to the CRS when you added google mapping? Why do you think this occurs?

6. Use File> save to save the project to your working area.

Intro to QGIS – Getting Started 12

Page 13: Introduction to QGIS Table of Contents

Air Photo Services Training Days 18-19th Dec 2014

Task 4 – GeoreferencingSetting the correct CRS and adding the Georeferencer plugin

1. To georeference an image we first need to decide what CRS we would like the final image to have. For the most accurate mapping it is best to use data that is in OSGB36, but if you have only satellite data to work with, it might be appropriate to keep EPSG 3857 (WGS 84 / Pseudo Mercator).

In this example we will return our project to OSGB by removing the Google satellite layer we added in the last task before georectifying a RCAHME plan.

2. In the layers menu, right click the Google Satellite layer and select remove.

3. This will remove the layer but if you check the CRS in the bottom status bar you'll see that it's still EPSG:3857 and our OS layers and photo are 'twisted' to match the WGS system. We change the CRS by clicking on the CRS Properties icon in the status bar.

Intro to QGIS – Getting Started 13

Page 14: Introduction to QGIS Table of Contents

Air Photo Services Training Days 18-19th Dec 2014

4. As for task 1, pick OSGB26 from the list in the menu and click OK. The project will now be in the 'correct' CRS to start georeferencing.

5. The functionality of QGIS can be expanded greatly by the use of plugins. We will now add the georeferencer plugin. Go to Plugins > Manage and Install Plugins

6. On the left column click All, and in the search bar at the top enter “georef”. Click to highlight on theGeoreferencer GDAL tool listing and click Install Plugin. You will now see the georeferencer in your toolbar. We will use this tool to georeference an image of the RCAHME survey of Chishenbury Warren.

7. Set up your GIS window by zooming to the area of the settlement (417860, 153800), then open the georeferencer tool.

Intro to QGIS – Getting Started 14

Page 15: Introduction to QGIS Table of Contents

Air Photo Services Training Days 18-19th Dec 2014

8. In the georeferencer window go to File > Open Raster and select the Chis_plan.jpg

9. You will ba asked for the CRS of the raster – confirm that this will be OSGB36. The file will then openin the georeferencer window.

10. You have a set of pan and zoom tools to navigate around the image, just like in the main GIS window.

11. The task now is to identify ground control points (GCP) on the scanned image that can be matched in the map, e.g. field boundary corners, road intersections, building corners. The more GCPs you have and the better spatial distribution across the scan, the more accurate the transformation will be.

When you have identified a good candidate GCP, click on the add point icon.

Intro to QGIS – Getting Started 15

Page 16: Introduction to QGIS Table of Contents

Air Photo Services Training Days 18-19th Dec 2014

12. You will be prompted to enter the co-ordinates of your selected point as easting / northing values or to pick from the map canvas. As we don't know the co-ordinates of this point we will pick from the map canvas (GIS window).

13. Once you have clicked on “pick from map canvas” your window will switch back to the GIS. Simply pick the corresponding point in your map (you can pan / zoom to get to the correct place first). Yourmap co-ordinates window will automatically populate with the easting and northing picked off the map.

Note that if you were using vectore data (such as OS Mastermap) rather than raster data to select your GCPs, you could snap to these layers.

14. Click OK to store this point as a GCP. It will now appear in the GCP table below the image.

15. Repeat this process to continue to pick points on your scan until you are happy with the coverage and quantity of GCPs. To transform your image click on the Start Georeferencing Icon

Intro to QGIS – Getting Started 16

Page 17: Introduction to QGIS Table of Contents

Air Photo Services Training Days 18-19th Dec 2014

16. You will be prompted for the type of transformation you want to do. We will pick polynomial 1, Nearest Neighbour and save the ouput file to our working area. We will also check the box to use 0 for transparency and to load the result into QGIS.

17. We can now check the results of our GCP selection in both the GIS window and in the georeferencer. In the georeferencer, the residual error of each point has been calculated in the tablebelow.

We can see that some GCPs are less accurate than others, and the poorer GCPs can be removed or from the table their position moved. We can also add new GCPS to improve the transformation.

In the example below, most of the points are OK except point ID 1 in the centre of the image. I can experiment with removing that point be unchecking the cross next to it in the GCP table. If the other points residuals improve once the box is unchecked I may want to remove this point using theremove point icon and re-run the transform.

Intro to QGIS – Getting Started 17

Page 18: Introduction to QGIS Table of Contents

Air Photo Services Training Days 18-19th Dec 2014

Intro to QGIS – Getting Started 18