Download your own copy of QGIS from qgis.com (works on Windows, MacOS X, and Linux)

Overview of the Interface

Welcome to QGIS! Quantum GIS (now just known as QGIS) is a cross-platform, free, and open source GIS application. It has all of the features one needs in a GIS and many more can be added simply using the community hosted plugin repository. The QGIS UI Reference Image can be used to get yourself situated if you are familiar with the ArcMap for Desktop UI.

For an interesting read on the differences between ArcGIS and QGIS checkout 27 Differences Between ArcGIS and QGIS. For a great read on what you might be missing if you only use ArcGIS checkout QGIS Features I long for while using ArcGIS.

Screen Cast Playlist

Finished Map

Map of Oklahoma with earthquakes shown as dots

Install Plugin (QuickMapServices)

To start things off we are going to jump right in and add a feature to QGIS using the plugin repository. Open “Plugins > Manage and Install Plugins” from the main menu. This is where you can manage all the plugins installed on your computer.

Search for QuickMapServices, select it, and click “Install plugin”

This should add a new secondary menu to the “Web” menu called QuickMapServices. (Web > QuickMapServices)

QGIS Install Quick Map Services plugin

Add Basemap

QuickMapServices provides a few open source map services by default but the power is in the Search. Open “Web > QuickMapServices > Search QMS” A new Panel should open called “SearchQMS.”

Using Quick Map Services Search

There are hundreds of options and you can explore that on your own time. For this lab let’s just use the Stamen Terrain Background basemap.

** I used Esri Terrain in the video but Stamen Terrain Background looks much better and is open source under the CreativeCommons 3.0 license **

** You need to add credit at the bottom right (Right Click “Stamen Terrain” Layer > Properties > Check “Place credit on the bottom right corner” **

Dialog box for QGIS

Import Geodatabes Vector file

Let’s save the project now that we have something in it. Project > Save. This will create a .qgs file in your project folder that is similar to the .mxd file of ArcMap.

Now we want to add some data from ArcMap. Problem is it is saved in the Esri Geodatabase format. No worries QGIS can handle that.

Open “Layer > Add Layer > Add Vector Layer…”

In the dialog box choose the “Directory” Source type then choose “OpenFileGDB” as the type. Browse to the “statesp010g.gdb” file you extracted and click “Select Folder”. Now click open we only need the statesp010g vector file, select that and click “OK”. (Unfortunately QGIS does not support rasters saved in a GDB so those need to be exported in ArcMap.)

QGIS Import Vector from Esri Geodatabase

Make the fill of the states be completely transparent we only need the state borders to be showing.

QGIS Change Vector Style

Import Shapefile

Let’s use the quick add buttons. Click the

icon on the left side of the screen. The Source type is “File” click Browse and find the earthquakesCA.shp file you downloaded and click open twice.

QGIS Import Esri Shapefile

Download USGS Earthquake Data

Go to earthquake.usgs.gov/earthquakes/search/. This is the USGS database search of all earthquakes since they have been recorded (~1970s). We are going to get the records of earthquakes that have occurred in Oklahoma since 2000.

Leave Magnitude at 2.5+; Change Date & Time to custom and set the Start (UTC) to “2000-01-01 00:00:00”; For geographic region select Custom and click Draw Rectangle on Map. In the dialog that pops up draw a rectangle around the state of Oklahoma; Open the Output Options section and choose CSV as the Format scroll down and click search. Save the query.csv file to your project folder.

Download Earthquake data from USGS database

Import CSV file

Now import that .csv file into QGIS.

Layer > Add Layer > Add Delimited Text Layer…

Make sure to select CSV (comma separated values) for the file format and Point Coordinates for the Geometry definition. (See figure)

For the Coordinate Reference System Selector filter for “EPSG:4326” (WGS 84), choose that, and click OK.

Dialog box for QGIS

** Don’t forget to save your project often! **

Save Shapefile

The last step creates a layer in QGIS but we want to save this data for use later. QGIS can save to several different formats but we will use the Esri Shapfile for consistency. (There are better formats but will just keep it simple).

Right click on the new earthquakesOK layer and click “Save As…”; Select ESRI Shapefile as the format (See lots of formats); Browse to your project folder and name the file earthquakesOK; Make sure the CRS is set to EPSG:4326, WGS 84 and click OK.

Dialog box for QGIS

Make sure to remove the CSV Layer so you only have one OK layer. If you can’t remember which is the CSV open the layer properties (right click > properties) and check the file path under the General Section. Layer Style

Let’s explore some of the Styles (Symbology in ArcMap) we can use in QGIS.

The Default is a single symbol for all markers. Change the size of the markers so they are larger for higher magnitude earthquakes.

Right Click > Properties. Click Style on the Left. Next to the size box there is a dropdown button. Click it > Field type: string, int, double > mag (double).

Now the marker size will be related to the magnitude.

Dialog box for QGIS

What we really want is different color and sized markers and we want to be able to see the larger magnitude quakes easily. This is where we use the Graduated style type and rendering order control.

Steps:

  1. Change style to Graduated
  2. Column to mag
  3. Change symbol marker size
  4. Change classes mode to Pretty Breaks
  5. Turn on Control feature rendering order and select mag as order.

QGIS change Vector Marker Size

** Save your project! **

** I show the style changes in California but you need to make the same changes in Oklahoma because that is the map you will be exporting **

Vector Statistics

QGIS has an easy to use summary statistics tool. We can use it to calculate some simple statistics for both California and Oklahoma.

Click the

button in the main toolbar to open the stats panel.

Select the Oklahoma layer from the top dropdown menu. In the white box select or type “mag”. This will display the statistics for the magnitude field in the layer.

Dialog box for QGIS

Now we want to do some analysis by only using data from certain time periods.

Make sure the earthquakesOK layer is selected in the layer panel. Click the

button in the main toolbar to open the Select by expression dialog.

Put “time” < 2010 in the expression box and click Select then Close.

Dialog box for QGIS

Now in the Stats Panel check the “Selected features only” box (bottom of panel). (Remember we only downloaded earthquakes after 2000 so this is showing all earthquakes from 2000-2010).

  • Make a note of the Count and Maximum values from this selection.

Now select all earthquakes that have occurred after 2010. (“time” > 2010)

When you are done click

to unselect all features.

Create Heat Map

Heatmaps in QGIS can be used to create density rasters of vector point layers using a Kernel Density Estimation. Heatmaps are an easy way to see clusters of vector points and in our case earthquake epicenters.

A simple display only way is using the Heatmap Style. Open the layer properties for the earthquakeOK layer and change the style to “Heatmap”; Change the color ramp to “Oranges”; in the layer rendering section change the “Layer blending mode” to “Multiply” and hit OK.

Dialog box for QGIS

This heatmap is only for display or print purposes. We can also use a built in plugin to create a raster.

Open the plugin manager (Plugins > Manage and Install Plugins) search for Heatmap and check the box next to it. Now create a raster using the enabled plugin.

Raster > Heatmap > Heatmap…

Select earthquakesOK

Save file heatmapOK in project folder

Change Radius to 10000 in layer units (meters)

Click okay.

** Now that you created a heatmap raster go back and change the earthquakesOK layer style back to blue and sized according to magnitude. **

Dialog box for QGIS

Style this raster similar to how we did before.

QGIS Style Heatmap Raster

** Make sure the map is in the EPSG:4326 CRS. Check the bottom right corner **

QGIS New Print Composer with Map

Create a new Print Composer (File > New Print Composer)

Add a new Map (Layout > Add Map) Set the scale to 1500000.

Add grid to the map (see screencast)

QGIS Add Legend, Scale Bar, and North Arrow

Add Legend, Scale bar and North arrow. ** North Arrow – I forgot to do this in the video but under the Image Rotation section check “Sync with map” **

QGIS Frame, Title and Export

Add Frame and Title to prepare to export (and export it) Deliverables

Add your exported image to a word document along with the completed table above.

Map should have Title, Legend, Scale Bar, North Arrow, Graticule, Base Map, Styled Earthquake points, and Heatmap Raster.

If you want more checkout qgistutorials.com.