Raster data as spatial layers

We are going to look at some different types of raster data today as well as exploring these data in both QGIS and ArcPro.

Starting with QGIS

NOTE: When you start QGIS – please start with the version of QGIS with GRASS.

  • Start Menu
  • QGIS 3.14 Folder
  • QGIS Desktop 3.14 With GRASS

Load the crop inventory file

Open up the raster file in the lab5/cropinventory folder in the GEOG204 foder on your L: drive. You can do so by dragging and dropping or by

  • Layer
  • Add Raster layer
  • Navigate to the L:/GEOG304/cropinventory folder
  • Load the file ending in .tif

Style the layer

Once the file is loaded, style the layer:

  • Right click ->Properties
  • Symbology -> Pelleted?unique values
  • Select a colour ramp, Browns to Blue Green works well enough -(BrBG)
  • Classify – hit the classify button
  • Remove the first two values (0 and 20)
  • Hit OK

What is the most common value

Once the data is loaded and styled you can visually see the crop classifications in British Columbia. Check out the histogram (counting out the number of pixels of each type of crop)

  • Right click
  • Choose the histogram tab on the left panel

There are two values that have a large spike in the count of pixels, one is 0 (non-values), what is the other values? If you hover over the bottom axis, you can see a magnifying glass allowing you to zoom in to areas along the axis

Add some data to determine crop type

The link below is a document that describes the crop inventory dataset.


Within the document there is a table that references the type of crop to the pixel values. We can also load a table in the same folder as the tif file into our project that has this reference

Load the aci_2019_bc.tif.vat.dbf file into your project – just drag it in from the QGIS browser or a file browser. Check out the table (attribute table).

Question 1:

What pixel (cell value) has the greatest count . What is the type of crop with the greatest count? From lecture, what number type is this raster data?

Questions 2:

What is the pixel size of the dataset in metres? How could you figure out the area covered by the crop types by knowing the number of pixels of each value (count column)?


Open the same dataset into ARCPro.

How is the data styled in ARCPro? It makes use of the crop inventory table (aci_2019_bc.tif.vat.dbf) to create the styling. Any ideas how?

Load in a DEM (Digital Elevation Model unbc_dem_alb.tif) located around UNBC

In the unbc_dem folder folder for this lab, add the unbc_dem_alb.tif file to your ArcPro project. Zoom to this layer and play around with the styling.

Creating some terrain layers – Starting with ArcPro

We are going to create some layers in both ArcPro and in QGIS. Before we can get going in ArcPro, we need to add a couple licenses for ourselves.

Add in licensing for terrain layers

  • Click on the project tab on the top ribbon
  • Click on the Licensing tab in the left panel
  • Select the “configure your licensing options” button
  • In the bottom panel activate “3D Analysis and Spatial Analysis
  • Click OK and return to the map

Create a slope layer

Switch to the analysis tab in the ribbon and type slope in the search field in the geoprocessing panel. Create a slope layer called unbc_slope.tif (or unbc_slope_arcpro.tif)

Using the Raster Calculator – ArcPro

Search the geoprocessing panel for “raster calculator” and launch the tool. Now query out slopes less or equal to 10 degree and save your new layer as slope_lt_10.tif

How does the results look? This is a layer that has pixels that represent areas (pixels from the slope layer) that have either slopes less than or equal to 10 degrees or slopes that are greater that 10 degrees.

Question 3:

What is the number type of the DEM layer? What is the number type of the layer from slope_lt_10 layer? Which value in this layers represent slopes less or equal to 10?

More Terrain Layers – QGIS

Back in QGIS, load the unbc_dem_alb.tif layers into your project.


Create an aspect layer using the “aspect” tool in the processing toolbox.

You have now created a layer that represents the direction the cell is facing (the slope of the cell) in regards to north-south-east-west.

Reclassify your data

Using the r.reclass tool in QGIS (GRASS function). Change this aspect layer into 4 classes (four quandrants that represent NW, SW, SE, NE). This is only one methods of classification – but it works pretty slick (use the image below for an example). Call this layer unbc_aspect_reclass.tif

Raster Calculator in QGIS

The raster calculator for QGIS can be found in the top Raster menu
Raster –>Raster Calculator. You can use it, or the one in ArcPro to carry out the question below

Question 4:

This is a two mark question performing the follow raster data query.

Using the raster calculator provide a resultant layer that meets the following requirements:

  • A Coniferous crop classification in the crop inventor layers aci_2019_bc
  • Slopes less than or equal to 10 degrees
  • South facing (aspect: 135 – 225)

Take a screen shot of your result and provide the query you used in the raster calculator

Save your answers together with the screen shot as lastname_firstname_geog204_A5 and send it to your TA by next week lab session.

Categories: GEOG 204Labs