Published on GEOG 585: Web Mapping (https://www.e-education.psu.edu/geog585)

Home > Lessons > Lesson 1: FOSS and its use in web mapping > Walkthrough: Installing and exploring QGIS

Walkthrough: Installing and exploring QGIS

The first FOSS product you'll use is a GUI-based program designed for desktop workstations. It's called QGIS (kyoo-jis), although you should know that sometimes in the past it was referred to as Quantum GIS. QGIS is somewhat similar in appearance and function to Esri's ArcMap, which you've likely used in previous courses.

In this tutorial, you'll install QGIS and make a basic vector map with it. You'll use some shapefiles of downtown Ottawa, Ontario, Canada that I originally downloaded from the OpenStreetMap database.

Download the Lesson 1 walkthrough data [1] (It is a folder of shapefiles that you should extract into a folder such as c:\data).

  1. Visit the QGIS home page at www.qgis.org [2]. Take a few minutes to explore this introductory page and any links that look interesting. This tells you a bit about who makes QGIS and what it can do.
  2. From the main QGIS page, click the Download Now Button.

    The usability of this page has greatly improved in the past few years. Because FOSS can run on a variety of platforms and can be built directly from source code (as opposed to running an installer program), it's not uncommon with FOSS to see mind-boggling installation instructions with all manner of parenthetical warnings, stipulations, dependencies, and links to obscure download pages. This was previously the case with QGIS, but now the experience is much smoother.
  3. You can now choose between the latest release of QGIS (version 2.18.x 'Las Palmas' at the time of this writing) or the most recent long term release (LTR) version (version 2.14.x 'Essen' at the time of this writing). The advantage of using the LTR version is that the examples in this course have been tested with this version and things on your screen will look very close to what is shown in the images you will see here. If you instead want to see all the features that QGIS has to offer right now and don't mind that things may look slightly different, feel free to go ahead and install the latest release. The deviations you will encounter with the examples in this course will for the most part only be very minor and can often be ignored (e.g., new options that can keep their default values or cases where GUI elements have been slightly rearranged). You can also simply install both version and switch between them.

    To start the download, click on the QGIS Standalone Installer link for the version that you have decided to use. Once you've downloaded it, run through the installation wizard and accept the default options:

    QGIS can also run on Mac or Linux. You will see installation instructions for these platforms, and you are welcome to use them; however, only Windows instructions are given in these lesson materials. (I know this is paradoxical for a FOSS course, but teaching you to use Linux is outside the scope of these lessons.) If you get hung up, you may be expected to troubleshoot on your own or default to a Windows machine in order to complete the exercises. If all you know is Windows, I suggest you stick with Windows for this course.

    The QGIS installation will place some other shortcuts and programs on your machine, such as GRASS GIS and OSGeo4W. This is fine. In fact, we will use some of these in later lessons.
  4. Start QGIS. You can do this through the Windows Start Menu > All Programs > QGIS (Version name/number) > QGIS Desktop (Version number).

    You will notice many toolbars available. In QGIS, the button you click to add data depends on the type of data source. For example, you click different buttons to add vector files, raster files, CSV files, web service layers, and layers from databases.
  5. Drag the toolbars around and clean up your display so that the layout looks something like the screenshot below (Figure 1.3). Don't worry about the order of the toolbars; just get them off the left-hand side.
  6. Click the button to add vector data. Add Vector Data Then, click Browse, and browse to the roads.shp file from the lesson data folder. Even though a shapefile consists of multiple files, you just need to browse to the .shp when adding a shapefile in QGIS.
     Screen capture: Roads layer in QGIS
    Figure 1.3
  7. In the left-hand layer list, double-click the roads layer. You'll see a bunch of styling options where you can set the line color, the line width, a scale range for visibility, and labeling. Set the roads as a thin gray line.

    Note: During this walkthrough, I will provide general guidance about which settings to apply, and I will lead you to the correct neighborhood of dialogs to accomplish it; however, I will not provide point-and-click instructions for all actions. Although you may curse my name for this, I am doing it deliberately so that A) you can think about what you are doing and B) you can develop the habit of exploring new and unfamiliar software in a fearless manner. This is an essential skill if you are going to use FOSS.

    That being said, it is not my intent to leave you frustrated and helpless. If something is not clear, please use the discussion forums to help each other out. I will regularly monitor the forums to make sure your question doesn't languish unanswered.

    Next, we'll put some labels on the roads.
  8. In the Layer Properties dialog box, use the Labels tab to label the roads layer with the roads' name attribute using a small gray font (this in the Text submenu). Set the label distance as 0.5 mm (this is in the Placement submenu of the Labels tab) so that the layer is not too close or too far away from the line. When working with streets, you might also want to check Merge connected lines to avoid duplicate labels (this is in the Rendering submenu). Finally, set Scale-based visibility preventing the labels from displaying when the map is zoomed out beyond 1:10000. When you are finished, you should have something like this.
     Screen capture: Labeled roads layer
    Figure 1.4
  9. Add the dataset natural.shp and symbolize it as a light green fill with no outline. You will need to set the Border style to No pen in order to accomplish this.
     Screen capture: Symbolizing natural areas
    Figure 1.5
  10. This is a good time to save your map. Click Project > Save As and save your map as Ottawa.qgs. It will be easiest if you save it in the same folder where your shapefiles live.
    Note: You may be accustomed to using the .mxd format, and now is an opportune time to learn that .mxd is a proprietary format that is used by Esri software. QGIS uses the .qgs format. If you open a .qgs file in a text editor, you'll observe that it's made of easily-readable XML.
  11. Add buildings.shp to the map, and experiment with a multilayer symbol to make the buildings “pop out.” Here's how I set this up:
     Screen capture: Symbolizing buildings
    Figure 1.6
  12. Add bus_stops.shp to the map, and symbolize it with an SVG marker like in the image below.
     Screen capture: Symbolizing bus stops
    Figure 1.7
    SVG stands for “scalable vector graphics.” It's a way of making marker symbols that don't get more pixelated as you expand their size. If you want a different color of marker, you can open the SVG in a graphics editing program such as the open source Inkscape, recolor and save a new version of the graphic, and then browse to it in QGIS.
  13. Set a scale range on the bus_stops layer so that it doesn't appear when zoomed out beyond 1:10000. You can do this in the General tab of the Layer Properties dialog box as shown below.
     Screen capture: Setting a scale range for bus stops
    Figure 1.8
    This is also a good time to set a user-friendly display name for this and other layers. The display name appears in the left-hand layer list.
  14. In the left-hand layer list, highlight the bus stops layer and click the Map Tips button. Map Tips button This adds some interactivity to the layer, a la Google Maps, so that when you hover over a stop, you can see the name of the corresponding bus line. As we work with web maps during this course, we'll work with getting the same kind of interactivity for particular layers of interest.

    Your map should now look something like the following:
    Screen capture of QGIS map with four layers
    Figure 1.9
  15. Save your map, then add some more shapefiles and experiment with symbolizing and labeling things in an aesthetically pleasing way.
  16. Post a screenshot of your beautiful QGIS map as a post on the "Lesson 1 walkthrough result forum" on Canvas. Include some commentary about any features you found useful.

Source URL: https://www.e-education.psu.edu/geog585/node/681

Links
[1] https://www.e-education.psu.edu/geog585/sites/www.e-education.psu.edu.geog585/files/lesson1/Ottawa.zip
[2] http://www.qgis.org/