This chapter gives a quick overview of installing QGIS, some sample data from the QGIS web page, and running a first and simple session visualizing raster and vector layers.


Installation of QGIS is very simple. Standard installer packages are available for MS Windows and Mac OS X. For many flavors of GNU/Linux, binary packages (rpm and deb) or software repositories are provided to add to your installation manager. Get the latest information on binary packages at the QGIS website at

Instalação à partir da fonte

If you need to build QGIS from source, please refer to the installation instructions. They are distributed with the QGIS source code in a file called INSTALL. You can also find them online at

Instalação no dispositivo de armazenamento externo

QGIS allows you to define a --configpath option that overrides the default path for user configuration (e.g., ~/.qgis2 under Linux) and forces QSettings to use this directory, too. This allows you to, for instance, carry a QGIS installation on a flash drive together with all plugins and settings. See section Menu Sistema for additional information.

Amostra de Dados

The user guide contains examples based on the QGIS sample dataset.

win The Windows installer has an option to download the QGIS sample dataset. If checked, the data will be downloaded to your My Documents folder and placed in a folder called GIS Database. You may use Windows Explorer to move this folder to any convenient location. If you did not select the checkbox to install the sample dataset during the initial QGIS installation, you may do one of the following:

nix osx For GNU/Linux and Mac OS X, there are not yet dataset installation packages available as rpm, deb or dmg. To use the sample dataset, download the file qgis_sample_data as a ZIP archive from and unzip the archive on your system.

The Alaska dataset includes all GIS data that are used for examples and screenshots in the user guide; it also includes a small GRASS database. The projection for the QGIS sample dataset is Alaska Albers Equal Area with units feet. The EPSG code is 2964.

PROJCS["Albers Equal Area",
SPHEROID["Clarke 1866",6378206.4,294.978698213898,

If you intend to use QGIS as a graphical front end for GRASS, you can find a selection of sample locations (e.g., Spearfish or South Dakota) at the official GRASS GIS website,

Launching QGIS

Starting and Stopping QGIS

Starting QGIS is done as you usually do for any other application on your platform. It means that you can launch QGIS by:

  • typing qgis at a command prompt, assuming that QGIS is added to your PATH or you’re in its installation folder
  • using nix the Applications menu if using a precompiled binary, win the Start menu or osx the Dock
  • double clicking the icon in your Applications folder or desktop shortcut
  • double clicking an existing QGIS project (.qgs) file. Note that this will also open the project

To stop QGIS, click:

  • nix win the menu option Project ‣ Exit QGIS or use the shortcut Ctrl+Q
  • osx QGIS ‣ Quit QGIS, or use the shortcut Cmd+Q
  • or use the red cross at the right top corner of the main interface of the application.

Opções da Linha de Comandos

In previous section you learned how to start QGIS. You will see that QGIS also provides further command line options.

QGIS supports a number of options when started from the command line. To get a list of the options, enter qgis --help on the command line. The usage statement for QGIS is:

qgis --help
QGIS - 2.6.0-Brighton 'Brighton' (exported)
QGIS is a user friendly Open Source Geographic Information System.
Usage: /usr/bin/qgis.bin [OPTION] [FILE]
  [--snapshot filename]   emit snapshot of loaded datasets to given file
  [--width width] width of snapshot to emit
  [--height height]       height of snapshot to emit
  [--lang language]       use language for interface text
  [--project projectfile] load the given QGIS project
  [--extent xmin,ymin,xmax,ymax]  set initial map extent
  [--nologo]      hide splash screen
  [--noversioncheck]      don't check for new version of QGIS at startup
  [--noplugins]   don't restore plugins on startup
  [--nocustomization]     don't apply GUI customization
  [--customizationfile]   use the given ini file as GUI customization
  [--optionspath path]    use the given QSettings path
  [--configpath path]     use the given path for all user configuration
  [--authdbdirectory path] use the given directory for authentication database
  [--code path]   run the given python file on load
  [--defaultui]   start by resetting user ui settings to default
  [--dxf-export filename.dxf]     emit dxf output of loaded datasets to given file
  [--dxf-extent xmin,ymin,xmax,ymax]      set extent to export to dxf
  [--dxf-symbology-mode none|symbollayer|feature] symbology mode for dxf output
  [--dxf-scale-denom scale]       scale for dxf output
  [--dxf-encoding encoding]       encoding to use for dxf output
  [--dxf-preset visiblity-preset] layer visibility preset to use for dxf output
  [--help]                this text
  [--]            treat all following arguments as FILEs

  Files specified on the command line can include rasters,
  vectors, and QGIS project files (.qgs):
   1. Rasters - supported formats include GeoTiff, DEM
      and others supported by GDAL
   2. Vectors - supported formats include ESRI Shapefiles
      and others supported by OGR and PostgreSQL layers using
      the PostGIS extension


Exemplo do Uso dos argumentos da linha de comandos

You can start QGIS by specifying one or more data files on the command line. For example, assuming you are in the qgis_sample_data directory, you could start QGIS with a vector layer and a raster file set to load on startup using the following command: qgis ./raster/landcover.img ./gml/lakes.gml

Opção da linha de comandos --snapshot

Esta opção permite que possa criar uma captura de ecrã no formato PNG da visão atual. Isto vem a calhar quando tem vários projetos e quer gerar capturas de tela dos seus dados.

Currently, it generates a PNG file with 800x600 pixels. This can be adjusted using the --width and --height command line arguments. A filename can be added after --snapshot.

Opção da linha de comandos --lang

Based on your locale, QGIS selects the correct localization. If you would like to change your language, you can specify a language code. For example, qgis --lang it starts QGIS in Italian localization.

Opção da linha de comandos --projeto

Starting QGIS with an existing project file is also possible. Just add the command line option --project followed by your project name and QGIS will open with all layers in the given file loaded.

Opção da linha de comandos --extent

Use esta opção para iniciar com uma extensão de mapa específica. Necessita adicionar uma quadro delimitador da sua extensão na seguinte ordem, seguido por uma vírgula:

--extent xmin,ymin,xmax,ymax

Opção da linha de comandos --nologo

This command line argument hides the splash screen when you start QGIS.

command line option --noversioncheck

Don’t check for new version of QGIS at startup.

Opção da linha de comandos --noplugins

Se você tiver problemas ao iniciar os complementos, poderá evitar iniciar-los com essa opção. Estarão sendo disponíveis depois no gerenciador de complementos.

Opção de linha de comando --customizationfile

Usando este argumento de linha de comando, você pode definir um arquivo GUI personalizado, que será aplicado ao iniciar.

Opção da linha de comandos --nocustomization

Usando este argumento de linha de comando, um arquivo GUI personalizado existente, não será aplicado ao iniciar.

Opção da linha de comandos --optionspath

You can have multiple configurations and decide which one to use when starting QGIS with this option. See Opções to confirm where the operating system saves the settings files. Presently, there is no way to specify a file to write settings to; therefore, you can create a copy of the original settings file and rename it. The option specifies path to directory with settings. For example, to use /path/to/config/QGIS/QGIS2.ini settings file, use option:

--optionspath /path/to/config/

Opção da linha de comandos --configpath

This option is similar to the one above, but furthermore overrides the default path for user configuration (~/.qgis2) and forces QSettings to use this directory, too. This allows users to, for instance, carry a QGIS installation on a flash drive together with all plugins and settings.

Command line option --authdbdirectory

Again, this option is similar to the one above but define the path to the directory where the authentication database will be stored.

Opção de linha de comandos --código

This option can be used to run a given python file directly after QGIS has started.

Por exemplo, quando se tem um arquivo python chamado com o seguinte conteúdo:

from qgis.utils import iface
raster_file = "/home/gisadmin/Documents/qgis_sample_data/raster/landcover.img"
layer_name = "Alaska"
iface.addRasterLayer(raster_file, layer_name)

Assuming you are in the directory where the file is located, you can start QGIS, load the raster file landcover.img and give the layer the name ‘Alaska’ using the following command: qgis --code

Command line options --dxf-*

These options can be used to export QGIS project into a DXF file. Several options are available:

  • –dxf-export: the DXF filename into which to export the layers;
  • –dxf-extent: the extent of the final DXF file;
  • –dxf-symbology-mode: several values can be used here: none (no symbology), symbollayer (Symbol layer symbology), feature (feature symbology);
  • –dxf-scale-deno: the scale denominator of the symbology;
  • –dxf-encoding: the file encoding;
  • –dxf-preset: choose a visibility preset. These presets are defined in the layer tree, see Layers Panel.

Sample Session: Load raster and vector layers

Now that you have QGIS installed and a sample dataset available, we would like to demonstrate a short and simple QGIS sample session. We will visualize a raster and a vector layer. We will use:

  • the landcover raster layer i.e., qgis_sample_data/raster/landcover.img
  • and the lakes vector layer i.e., qgis_sample_data/gml/lakes.gml.
  1. Start QGIS as seen in Starting and Stopping QGIS
  2. Click on the addRasterLayer Add Raster Layer icon.
  3. Navegue até a pasta qgis_sample_data/raster/, selecione o arquivo ERDAS IMG landcover.img e clique [Abrir].

  4. If the file is not listed, check if the Files of type selectString combo box at the bottom of the dialog is set on the right type, in this case Erdas Imagine Images (*.img *.IMG).
  5. Now click on the addOgrLayer Add Vector Layer icon.
  6. radioButtonOn File should be selected as Source Type in the new Add vector layer dialog. Now click [Browse] to select the vector layer.
  7. Browse to the folder qgis_sample_data/gml/, select Geography Markup Language [GML] [OGR] (*.gml *.GML) from the Filter selectString combo box, then select the GML file lakes.gml and click [Open]. In the Add vector layer dialog, click [OK]. The Coordinate Reference System Selector dialog opens with NAD27 / Alaska Alberts selected, click [OK].
  8. Zoom in a bit to your favourite area with some lakes.
  9. De duplo clique na camada lakes da legenda do mapa para abrir o diálogo Propriedades

  10. Clique na janela Estilo e selecione um preenchimento de cor azul.

  11. Click on the Labels tab and select Show labels for this layer in the drop-down menu to enable labeling. Then from the Label with list, choose the NAMES field as the field containing labels.
  12. To improve readability of labels, you can add a white buffer around them by clicking Buffer in the list on the left, checking checkbox Draw text buffer and choosing 3 as buffer size.
  13. Clique [Aplicar]. Confira se o resultado ficou bom e clique finalizar [OK].

You can see how easy it is to visualize raster and vector layers in QGIS. Let’s move on to the sections that follow to learn more about the available functionality, features and settings, and how to use them.


The state of your QGIS session is considered a project. QGIS works on one project at a time. Settings are considered as being either per-project or as a default for new projects (see section Opções). QGIS can save the state of your workspace into a project file using the menu options Project ‣ fileSave Save or Project ‣ fileSaveAs Save As.... If the loaded project file on disk was meanwhile changed, by default, QGIS will ask you if you want to overwrite the changes into the project file. This behavior is set by checking checkbox Prompt to save project and data source changes when required under Settings ‣ Options ‣ General menu .

Load saved projects into a QGIS session using Project ‣ fileOpen Open..., Project ‣ New from template or Project ‣ Open Recent ‣.

At startup, a list of screenshot with the name and path of each of the most recent projects (up to ten) is shown instead of a white and empty map canvas. This is a handy and quicker way to remember what a project was about and double-click a row opens the selected project. If you’re willing to create a new project, just add new layers and the list disappears.

If you wish to clear your session and start fresh, choose Project ‣ fileNew New. Either of these menu options will prompt you to save the existing project if changes have been made since it was opened or last saved.

O tipo de informação salva num arquivo de projeto inclui:

  • Camadas adicionadas

  • Which layers can be queried
  • Layer properties, including symbolization and styles
  • Projeção para a vista do mapa

  • Última extensão visualizada

  • Compositores de Impressão

  • Print Composer elements with settings
  • Print Composer atlas settings
  • Digitizing settings
  • Table Relations
  • Project Macros
  • Project default styles
  • Configurações de complementos

  • QGIS Server settings from the OWS settings tab in the Project properties
  • Queries stored in the DB Manager

The project file is saved in XML format, so it is possible to edit the file outside QGIS if you know what you are doing. The file format has been updated several times compared with earlier QGIS versions. Project files from older QGIS versions may not work properly any more. To be made aware of this, in the General tab under Settings ‣ Options you should tick checkbox Warn when opening a project file saved with an older version of QGIS.

Whenever you save a project in QGIS a backup of the project file is made with the extension .qgs~.

Arquivo de Saída

There are several ways to generate output from your QGIS session. We have discussed one already in section Projetos, saving as a project file. Here is a sampling of other ways to produce output files:

  • Menu option Project ‣ saveMapAsImage Save as Image... opens a file dialog where you select the name, path and type of image (PNG, JPG and many other formats). A world file with extension PNGW or JPGW saved in the same folder georeferences the image.
  • Menu option Project ‣ DXF Export... opens a dialog where you can define the ‘Symbology mode’, the ‘Symbology scale’ and vector layers you want to export to DXF. Through the ‘Symbology mode’ symbols from the original QGIS Symbology can be exported with high fidelity.
  • Menu option Project ‣ newComposer New Print Composer... opens a dialog where you can layout and print the current map canvas (see section Compositor de Impressão).