2. The QGIS Interface

QGIS provides an easy to use Graphical user interface (GUI) to explore, create and edit geospatial data. Commands and functions are activated using a combination of menu, toolbar and keyboard shortcut actions within the application.

This exercise will explore the basic interface of QGIS. You will create your first QGIS project, load various data layers, customize the appearance of your map using various data symbology and colors.

We will use the provided Quiapo dataset.

Interface Overview

_images/qgis_interface_overview.png
  • 1. Map Legend/Layers - where you add layers and interact with them, such as grouping them, setting symbology, and such.
  • 2. Map View - the main map area where the layers show up and all your visualization is done.
  • 3. Tool Bar - button bars. Like most modern windows applications you can drag your button bars around and move them between layers. Hover over each button and you will get a short description of what it is for.
  • 4. Menu Bar - most of the functionality in the Toolbar are up here as well. Don’t forget the all-important Help . QGIS has good documentation so use it.
  • 5. Status Bar - shows status, coordinates and scale of the Map View. Sometimes map display updates also called rendering can be slow when using large data files. You can turn off rendering when dealing with large files until you want to see the layers.

2.1. Creating a new project

1. Launch QGIS by clicking Start –> All Programs –> QGIS Dufour –> QGIS Desktop 2.0.1 .

2. Create a new project. Project ‣ mActionFileNew New Project.

A QGIS session is considered a Project. QGIS works on one project at a time. Settings are considered as being per-project or as a default for new projects. The kinds of information saved in a project file include:

  • Layers added;
  • Layer properties, including symbolization;
  • Projection for the map view and;
  • Last viewed extent.

Warning

The project file is saved in XML format (with a .qgs file extension), it is possible to edit the file outside QGIS if you know what you are doing.

3. Open the project properties. In the Menu, select Project Properties.

_images/project_properties.png
  • In the General tab you can define the project title, selection and background color, layer units, precision, and the option to save relative paths to layers.
  • The Coordinate Reference System (CRS) tab enables you to choose the CRS for this project, and to enable on-the-fly re-projection of layers when displaying layers from a different CRS.
  • The Idenitfy Layers tab you set (or disable) which layers will respond to the Identify tool.

4. Select the Coordinate Reference System (CRS) tab. Click the small triangle on the left side of the Geographic Coordinate System. This shows another list of CRS. Choose WGS 84. Click Apply then, OK.

Note

There is no need to set the CRS of the project if the layers to be loaded are of the same projection because QGIS will draw the coordinates using the data source. However, the On The Fly transformations needs to be enabled and the projection to be followed selected if the layers are of different projections.

_images/set_crs.png

Tip

Many GIS application opens any geospatial data (vector or raster) without asking for the coordinate referencing systems. QGIS follows a similar behavior. However, it is good practice to select the correct CRS whenever you start a new project. This habit can help you with problems in the future.

2.2. Opening Vector data

1. Add vector layers. In the Menu, select Layer ‣ mActionAddOgrLayer Add Vector Layer.

_images/add_vector_layer.png

In the Source type, choose Project. Click Browse and double-click to your extracted data directory.

Select multiple vector layers by holding the Ctrl button of your keyboard while selecting files. Select the following files:

admin_bnd.shp
buildings.shp
ecclesiastical_bnd.shp
pois.shp
roads.shp
_images/add_vector_layer_select.png

Once all the files are selected, Click Open. All vector layers will be loaded within your Map View area.

_images/loaded_layers.png

Vector data are represented as either point, line or polygon. The type of vector depends on what information you wish to convey.

  • Points - represented by a single X,Y coordinate. A point normally represents a geographic feature that is too small to be displayed as a line or area. For example, oil wells and fire hydrants.
  • Lines - A set of ordered coordinates that represent the shape of geographic features too narrow to be displayed as an area at the given scale or linear features with no area (county boundary lines). For example, railways, roads, rivers.
  • Polygons - A feature used to represent areas. A polygon is defined by the lines that make up its boundary and a point inside its boundary for identification. Polygons have attributes that describe the geographic feature they represent. For example, forest stands, lakes.

2. Arrange the display order of layers by selecting a layer in the Map Legend and then drag to either above or below the other layers.

_images/drag_layers.png

Arrange the data according to this list from top to bottom:

pois.shp
roads.shp
buildings.shp
ecclesiastical_bnd.shp
admin_bnd.shp

Tip

Mapping standards suggest that points layers should be on top followed by lines and finally polygons.

2.3. Changing the look of your data layer

1. Changing vector layer properties like color and symbolization. Select the admin_bnd layer and right-click on the layer and select Properties from the pop-up menu.

_images/select_vector_properties.png

The Layer Properties dialog for a vector layer provides information about the layer, symbology settings and labeling options. This dialog box allows you to customize the overall look of your vector data layers.

_images/vector_layer_properties.png

2. Select the Style tab. This provides you several ways to control how vector features are displayed. For this layer, we will change the fill color. In the Legend type, select Single Symbol.

_images/select_symbol_color.png

3. In the Fill options, click on the Fill options color. Another window showing the Select Color will then appear. Set the Red, Green, Blue (R:G:B) values to 253:246:229 respectively and click OK.

_images/select_color.png

4. Select the General tab. This provides ways to change the display name, set scale dependent rendering options, create a spatial index of the vector file and view or change the projection of the specific vector layer. Change the Display name to Administrative boundaries.

_images/general_tab.png

5. Click Create Spatial Index. A spatial index will improve the speed of both zooming and panning. Spatial index used by QGIS have a .qix extension. Click Apply –> OK.

6. Repeat all the steps above to change layer properties of each vector. Follow the table below:

Layer Display Name Legend Type Icon Border Options (RGB) Fill Options(RGB)
pois POIs Single Symbol small black circle n/a n/a
roads Roads Single Symbol n/a 150:150:150 None
buildings Buildings Single Symbol n/a 111:111:111 215:194:209
ecclesiastical_bnd Ecclesiastical boundaries Single Symbol n/a 50:50:50 None

7. Explore the other options of the vector properties. The Layer Properties provides several options to customize the look and feel of your layers. Use the other options until you’re satisfied with the look. Try the following:

  • Legend types
  • Outline/Line options
  • Fill options
  • Different markers for points
  • Transparency

2.5. Saving your first project

1. In the Project menu, select mActionFileSave Save Project. In the Filename field, type:

myfirstqgisproject.qgs

2. Click Save. You have saved your first QGIS project.

2.6. Other tips

1. Map Overview

The map overview panel provides a full extent view of layers added to it. Within this panel is a red box showing the current Map View extent. This allows you to quickly determine which area of the map you are currently viewing.

To activate the Map Overview, in the Menu, select View ‣ Panels –> Overview. A new panel will be added below the Map Layers (no map is displayed at the moment).

_images/panels_overview.png

We will add the Ecclesiastical boundaries layer in the overview map. Select the Ecclesiastical boundaries layer, then right-click and select Show in Overview.

The Ecclesiastical boundaries layer should appear in the Overview panel.

_images/overview_panel.png

You can also add more layers or remove them. If you click and drag the red rectangle in the overview that shows your current extent, the main Map View will update accordingly.

Warning

Do not add too many layers into the Overview panel, this can slow down rendering of the overview map.

2. Line and Area Measurements

To interactively measure length and area, use the:

  • mActionMeasure Measure Line
  • mActionMeasureArea Measure Area

The tool then allows you to click points on the map. Each segment-length as well as the total shows up in the measure-window. To stop measuring click your right mouse button. Areas can also be measured. The accumulated area-size will be visible in the measure window.

Warning

Length and area results inherit the default projection and ellipsoid units! If you are using the Decimal Degrees (which is the case in our current project) as the layer units, the length and area results will be in decimal degrees as well.

3. Using the Labeling Tool

The Labeling tool provides smart labeling for vector point, line and polygon layers and only requires a few parameters.

Select the Roads layer.

Open the labeling plug-in, in the Menu, select Layer ‣ Labeling.

_images/smart_label_plugin.png

A new window will appear for the Layer labeling settings. Mark the following options shown in the screenshots below:

_images/smart_label_properties.png _images/smart_label_properties1.png

Select OK. The label for Roads should be placed above the road line. As you pan around the map, you’ll find that labels are placed nicely.

_images/smart_label_roads.png

4. Importing Image

To import the Map View into an image, in the Menu, select Project ‣ Save as image.

Select your preferred filename and image type. Click Save. You now have you first map image which you can add in any document or report.

_images/import_image.png

5. Save your project. To save your project, select Project ‣ Save Project.

Tip

It is good practice to save your project after every major editing activity. Make sure you save your project frequently. Or better, practice the keyboard shortcut to save projects: Ctrl + S.