project logo

QGIS Quickstart

Quantum GIS (QGIS) is a user friendly Desktop GIS client which lets you visualize, manage, edit, analyse data and compose printable maps.

Edit QGIS project

Let’s start by opening up an existing QGIS project, and turning layers on and off.

  1. Lauch QGIS from Geospatial ‣ Desktop GIS ‣ Quantum GIS and select File ‣ Open Project... from the menu bar.

  2. Choose QGIS-NaturalEarth-Example.qgs and press Open.

    • You should see a world map.
  3. Tick the ne_10m_populated_places check box in the Layers tree.

    • Populated places are now displayed as many green dots:

  4. Try dragging layers up and down in the legend and see how that effects visiblity of the layers below.

  5. Have a look at the tools on the tool bar. Try panning, zooming in, and zooming back out to full extent again. Find these tools next to the hand icon. If the toolbars seem cluttered you can drag them around and turn them on and off by right clicking. You can also zoom in and out with the mouse wheel, and pan with a left-click drag.

Style a layer

Now let’s try customising the style of the map.

  1. Zoom in a little on the map, then double click ne_10m_rivers_lake_centerlines in the Layers tree.
  2. Change the color in Outline Options to a different color, say yellow.
  3. Press OK.
    • Notice that rivers are now rendered in your new color.

Create a new QGIS project

Let’s now create a new QGIS project and load our own data.

  1. Choose File ‣ New Project.
  2. Click Layer ‣ Add Vector Layer....
  3. Browse to dataset /home/user/data/natural_earth2/ne_10m_admin_0_countries.shp.
  4. Press Open then Open again.
    • You should see all world countries.

Connect to a PostGIS spatial database

Let’s now include a layer from a Postgres database.

  1. In the layer list on the left, untick the ne_10m_admin_0_countries visibility check box to temporarily hide it.

    Connecting to a PostGIS DB
  2. Choose Layer ‣ Add PostGIS Layers....

    • Both Natural Earth and OpenStreetMap Postgis databases are already available; we will be using use the Natural Earth database. If you wanted to connect to a different database, you would select the New button and fill in the database parameters.
  3. Select the “Natural Earth” connection and press Connect.

    • A list of database tables will appear.
  4. Select ne_10_populated_places and click Add.

  5. Zoom in on the United States using the mouse wheel and left-click drag to navigate.

  6. Right click on ne_10m_populated_places in the layer list to get a context menu, then select Properties.

  7. Let’s represent one of the database attributes in the data as a bubble plot. In the middle of the Layer Properties window, drag the Transparency slider to 50%, press the Advanced button and select Size scale field, then choose elevation (it’s in about the middle of the list), and finally set the symbol Size scaling to 0.01. Then click Ok.

  8. You can then click on the query button on the toolbar (cursor arrow with a blue “i”) and then on the map canvas bubbles to view information about the individual cities.

Using the GRASS Toolbox

There have been many plugins written for QGIS which extend QGIS’s core functionality. One of the more powerful is the GRASS plugin, which taps into the hundreds of geospatial processing modules available from GRASS GIS.

  1. Clear the slate with File ‣ New Project.

  2. Choose Plugins ‣ Manage Plugins, then scroll down or type grass into the Filter box, and select the GRASS plugin.

    • Notice that a new GRASS icon has been added to the Toolbar, and a new GRASS menu item has been added to the Plugins menu.
  3. Connect to an existing GRASS workspace with Plugins ‣ GRASS ‣ Open mapset.

    • The GRASS GIS data base (Gisdbase) has already been set to ~/grassdata on the disc for you.
  4. Within the central GRASS data base are a number of sample datasets. We’ll load the North Carolina location, and the user1 mapset within it. Choose the nc_basic_smp Location and user1 working mapset, then click Ok.

  5. To add a map to the QGIS layer list, choose Plugins ‣ GRASS ‣ Add GRASS raster layer.

    • In the PERMANENT mapset select the elevation_shade map and click Ok.

      GRASS GIS layers loaded into QGIS
  6. Add another GRASS raster layer, this time the elevation map from the PERMANENT mapset.

    • Double click on the elevation map in the QGIS layer list and set its transparency to 65%.
  7. To add a vector map, choose Plugins ‣ GRASS ‣ Add GRASS vector layer.

    • From the PERMANENT mapset select the roadsmajor map and click Ok.

The plugin also gives you access to many of the powerful GRASS analysis modules and visualization tools:

  1. From the top menu select Plugins ‣ GRASS ‣ Open GRASS tools and drag the edge to make the window a bit bigger.
    • A long list of analysis tools will appear. Go to the Module Tree tab and select Region settings ‣ g.region.multiple.raster. Clicking on it will open a new tab. Simply type elevation for the raster map name and press Ok. The elevation map will now have a thin red line around it, indicating the extent of GRASS’s computational region bounds.
  2. Back in the Module Tree tab of the GRASS Tools window, go down to 3d Visualization and select NVIZ. You may need to drag the corner of the toolbox window again to make it a bit larger to see all the options.
  3. In the new module tab that pops open, select the elevation map as the map for elevation. Then depress the rectangle with red corners button on the right of the map name to use the region bounds and resolution of that map. As mentioned earlier, the computational region is a core theme in GRASS raster processing.
  4. Select roadsmajor for the vector overlay, then click Run.
  5. Once the NVIZ 3D view opens, maximize the window and drag the positioning puck in the compass box on the left to a nice view.
  6. Choose Visualize ‣ Raster surfaces and set the fine resolution to 1, then if needed click the green DRAW button in the top left and wait while it renders.

Using the SEXTANTE Toolbox

Another major plugin for QGIS which opens the door to a large family of processing tools is the SEXTANTE Toolbox. It acts as a standardized wrapper around a number of other sets to tools.

  1. To enable it, choose Plugins ‣ Manage Plugins, then scroll down or type sextante into the Filter box and select the SEXTANTE plugin. Then click Ok.
    • A new Analysis menu and toolbar will appear.
  2. Choose Analysis ‣ Sextante Toolbox.
    • A new toolbar will open on the right side of the screen with many processing tools to choose from. Take some time and have a look around.

Using the OpenStreetMap plugin

  1. Open the Terminal Emulator from the Xubutu Applications ‣ Accessories menu.

    • Cut and paste the following commands into the Terminal window to create a working copy of the OSM data in the home directory:

      cp data/osm/feature_city_CBD.osm.bz2 .
      bzip2 -d feature_city_CBD.osm.bz2
  2. In QGIS, choose File ‣ New Project. If you had the SEXTANTE Toolbox open you might want to close it.

  3. Choose Plugins ‣ Manage Plugins.

    The OpenStreetMap plugin
  4. Scroll down or type open into the Filter box and select the OpenStreetMap plugin. Then click Ok.

    • A new Web menu and toolbar will appear and a toolbar on the right side of the map canvas.
  5. Choose Web ‣ OpenStreetMap ‣ Load OSM from file.

  6. Click on the ”...” button and select the feature_city_CBD.osm file you just copied into the home directory.

  7. Tick the name, highway, and amenity check boxes.

  8. Choose Medium scale rendering, then click Ok.

  9. You can now explore this rich dataset. Use the i information cursor button in the OSM Feature Manger side-toolbar to query individal map features.

Things to Try

  • Try viewing data sources with the QGIS Data Browser in the Geospatial ‣ Databases menu
  • Try publishing your QGIS map to the web using QGIS Map Server in the Geospatial ‣ Web Services menu.

What Next?

Tutorials for more advanced features of QGIS are collected as OSGeo-Live QGIS tutorials.

To learn more about QGIS, a good starting point is the Documentation page on the QGIS homepage.

A Gentle Introduction to GIS [1] eBook and the QGIS User Guide [2] are also included on OSGeo-Live.

Copyright & Disclaimer