Raster Data Extraction using QIS
Raster files consist of a grid of cells, each cell contains a numeric value, which is used to determine how to colour each cell. This value may be based on the elevation of the cell, flood water depth, or soil quality. It is possible to extract this information by point sampling or using a terrain profile. Point sampling copies the cell’s value to the overlying point. A terrain profile tool plots a graph with the cell’s value (elevation) on the Y axis and the distance along the section on the X axis.
Point Sampling Tool
DEM’s are often used to then update the elevation values of overlying points, for example I have used data from DEM’s to update the elevation values of address points and utilities. This isn’t as accurate as surveying each point, but it is a lot quicker! This process is also referred to image extraction, raster/vector conversion.
For this tutorial, you will need:-
- The Point Sampling tool in QGIS is an optional plugin. You can download it by using the menus to select Plugins, Fetch Python Plugins.
- Nasa’s srtm data, which you can download from here: http://srtm.csi.cgiar.org/
- Some point data. If you can’t think of any, then they’re easy to create, for example use the Open Layers plugin to load Open Streetmap or Google Maps of your area, and then create points over a few cities.
I’m going to add the elevation value from the srtm rasters to a selection of UK towns and cities:-
- Use the menus to select Plugins, Analyses, Point Sampling Tool
- The Point Sampling Tool dialogue box opens. Select:-
- The layer that contains the points to be sampled
- The layer(s) with the field(s)/band(s) to get values from
- The output (results) file
- Press OK
The results file just contains the elevations:-
It is possible to add these to the original layer:-
- Create a buffer around the new points
- Use the menus to select Vector, Data Management Tools, Join Attributes By location
- Select the original points as the target and the buffer as the join layer
Another option is to update the x and y co-ordinates for both points using the Field calculator and then to match the rows in Excel on the co-ordinate column.