ºÚÁϳԹÏÍø

Data @ Reed

QGIS Intro

Understanding GIS Files

GIS data is more complicated than just loading in a single spreadsheet. You will only need to load specific files but those files will use other files behind the scenes, so all files must be kept in the same folder. The following are the most typical types of files included.

For vector data:

  • .shp: the shapefile that shows the geometry for the map (shapes that will be displayed)
  • .shx: the shape index position (tells where on the map the shape goes)
  • .dpf: the attribute data (typical spreadsheet type data)
  • .prj: the projection system (what type of map coordinates)
  • .gdb: geodatabase is a collection of files in a folder on disk that can store, query, and manage both spatial and nonspatial data

For raster data:

  • .tif: the image to be displayed
  • .tfw: coordinates for the image
  • .vat: attribute data for raster

Optional

  • .qpj: the QGIS specific projection
  • .cpg: additional data for the .shp file

Your main takeaway from this just needs to be that all these files need to stay together. You don’t need to memorize what each type of file does. But all are necessary for the map to load, so always keep downloaded folders of data intact and don’t move or delete files even if you never directly open them.


Commonly Used Oregon GIS Shapefiles

This is a link to a zipped folder of commonly used Oregon files. It contains the following:

  • Oregon_State_Boundary: boundary for Oregon
  • pdx_proper: boundary for the Portland Metro area
  • OR_counties: counties in Oregon 
  • OregonRoads: highways in Oregon
  • river: a partial map of waterways around Multnomah county area
  • vegetation: a layer with vegetation classes (shrub, forest, etc) around Multnomah county area

Loading Files into QGIS

In this example, you will learn how to load data related to vegetation in Portland. All the files are found publically on . You will need to download the zip file described above. Once the file is on you computer, double click it to unzip it. As explained in the files section, you don't really need to do anything else with these files except make sure they stay in the same folder and that you know where that folder is. Best practice would be to make a folder called something like "QGIS Practice" and move the entire unzipped folder into that folder. 

Important things to note:

  • It is a good idea to save your map project frequently.
  • If a window seems to disappear, look behind your main window (sometimes windows shuffle to the back).
  • If the program is not responding in a way you expect, double-check to make sure there isn’t a window hiding somewhere that is waiting for your input.
  • QGIS does not automatically close windows after it runs a process. If you aren’t sure if something has happened, take a look at your map and your list of data layers.
  • If your map is blank, make sure you are zoomed to the layer (more on this below).

1. Download QGIS if you have not already and download the zipped data files for this tutorial. Unzip them and move them to wherever you would like on your computer.

2. Open QGIS.

3. Click to open the Data Source Manager to load data.

view of QGIS showing where data manager is in circleThis will let you load all types of data, but you need to be sure you are selecting the right type for your file. We will load in the Portland boundary map, which contains vector files, so ensure that you have "Vector" selected in the left panel.

 

4.  Next click the three dots next to Source: Vector Datasets and in the pdx_proper folder select the pdx_proper.shp file from the counties folder. Leave everything else as is and click Add. Once you press Add once, the file is added, but you may not be able to see that right away. Press Close and you should see the new layer. (If a box pops up asking you about CRS Transformations, just say OK.) 

shows vector file circled

You should see something that looks similar to the following picture. The color may be different. QGIS automatically picks a random color for any files added. You can change the color later. This file has loaded in as a layer. Every layer is displayed on the bottom right panel. If a layer is checked it is visible, if not it is hidden. Layers are shown in order they appear.

map of Portland city boundary

5. Next we will add a road map for all of Oregon. It is also a vector file, so the procedure is the same. Click the Data Source Manager, ensure you are in Vector files on the left, click the three dots and add the roads.shp file. (Again, if a box pops up asking you about CRS Transformations, just say OK. It's asking if you want the road layer to match the CRS of the boundary, and you do.) You should see a map similar to the following:

map of Portland area

Notice on the lower left there is a new layer called roads. You can zoom in and out to view the layers in more detail using your touch pad. 

6. Now add the other .shp files from the data you downloaded. They are also vector files, so repeat the steps above to add the Vegetation, river, OR_counties, and Oregon_State_Boundary files. Right click on the layers and rename them to labels that make sense to you.

7. You can click and drag the layers in the Layers panel in order to reorder things. The layer on top is the most visible. See what happens when you move the state boundary to the top vs the river on top.

the layer panel of QGIS

8. Right click on the river layer and go to Zoom to Layer(s). Your map should zoom in to look something like the following map. If you do the same Zoom to Layer(s) action on the Oregon boundary it will zoom out to the whole state. If you ever find yourself way off the map, you can right click a layer in the panel to reorient yourself.

an ugly and illegible map of the portland area


 

Editing the Map

That map is pretty ugly, but we can change that. 

9. Right click on the river layer and go down to Styles. From here you can quickly change the water color to be blue. Change the other layers to your desired colors. 

 the style menu from the layers panel

10. We can get more detail on styling layers by right clicking and going to Properties and then the Symbology tab. Go to the Symbology for the counties layer. Scroll down in the Project Style to choose a blue outline, and we can see just the outline of the counties instead of having them as solid objects. 

the symbology options

You can also click on the Simple Line description to change the color of the line and its thickness.

the line symbology options

11. Zoom in on the Vegetation layer and make sure it is completely visible (put it on top of the Portland boundary). Right now this layer is a single color, but it contains information that could be color coded. Right click on it and go to Open Attribute Table to see the data in this layer. You should see a table open that looks like this: 

the vegetation data table with multiple columns of data, including vegetation class

Here we can see that in the NVCS_CLASS column, there are labels for different types of vegetation.

12. By again changing the symbology, we can color by these different classes of vegetation. Go to the Symbology and change the top drop down menu from Single Symbol to Categorized. Then for the Value menu, choose NVCS_CLASS. Click the Classify button at the lower left to assign colors to each class. 

the classify symbology options

Click Apply and OK to see the map change to show the color of the different vegetation types. 

the map around portland with different vegetation patches as different colors