Outdated version of the documentation. Find the latest one here.

Trabalhando com Projeções

QGIS allows users to define a global and project-wide CRS (Coordinate Reference System) for layers without a pre-defined CRS. It also allows the user to define custom coordinate reference systems and supports on-the-fly (OTF) projection of vector and raster layers. All these features allow the user to display layers with different CRS and have them overlay properly.

Visão geral do Suporte de Projeções

QGIS has support for approximately 2,700 known CRS. Definitions for each of these CRS are stored in a SQLite database that is installed with QGIS. Normally you do not need to manipulate the database directly. In fact, doing so may cause projection support to fail. Custom CRS are stored in a user database. See Section Sistema de Referência de Coordenadas Personalizado for information on managing your custom coordinate reference systems.

The CRS available in QGIS are based on those defined by the European Petroleum Search Group (EPSG) and the Institut Geographique National de France (IGNF) and are largely abstracted from the spatial reference tables used in GDAL. EPSG identifiers are present in the database and can be used to specify a CRS in QGIS.

In order to use OTF projection, your data must contain information about its coordinate reference system or you have to define a global, layer or project-wide CRS. For PostGIS layers QGIS uses the spatial reference identifier that was specified when the layer was created. For data supported by OGR, QGIS relies on the presence of a recognized means of specifying the CRS. In the case of shapefiles, this means a file containing the Well Known Text (WKT) specification of the CRS. This projection file has the same base name as the shapefile and a prj extension. For example, a shapefile named alaska.shp would have a corresponding projection file named alaska.prj.

Whenever you select a new CRS, the used layer units will automatically be changed in the General menu of the mActionOptions Project Properties dialog under the Project (Gnome, OSX) or Settings (KDE, Windows) menu.

Global Projection Specification

QGIS starts each new project using the global default projection. The global default CRS is EPSG:4326 - WGS 84 (proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs) and comes predefined in QGIS. This default can be changed using the [Select...] button in the first section, used to defining the Default Coordinate Reference System to use when starting new projects, as shown in figure_projection_1. This choice will be saved for use in subsequent QGIS sessions.

Figure Projection 1:


CRS tab in the QGIS Options Dialog nix

When you use layers that do not have a CRS, you need to define how QGIS responds to these layers. This can be done globally or project-wide in the CRS menu under Settings ‣ mActionOptions Options.

The options shown in figure_projection_1 are:

  • radiobuttonoff Prompt for CRS
  • radiobuttonoff Use project CRS
  • radiobuttonon Use default CRS displayed below

If you want to define the coordinate reference system for a certain layer without CRS information, you can also do that in the General menu of the raster (see General Menu) and vector (see General Menu) properties dialog. If your layer already has a CRS defined, it will be displayed as shown in Vector Layer Properties Dialog .


SRC na Legenda de Mapas

Right-clicking on a layer in the Map Legend (Section Legenda do Mapa) provides two CRS short cuts. Set layer CRS takes you directly to the Coordinate Reference System Selector dialog (see figure_projection_2). Set project CRS from Layer redefines the project CRS using the layer’s CRS

Define On The Fly (OTF) Reprojection

QGIS supports OTF reprojection for both raster and vector data. However, OTF is not activated by default. To use OTF projection, you must activate the checkbox Enable on the fly CRS transformation checkbox in the CRS menu of the mActionProjectProperties Project Properties dialog.

There are three ways to achieve this end:

  1. Select mActionOptions Project Properties from the Project (Gnome, OSX) or Settings (KDE, Windows) menu.
  2. Clique no ícone geographic :sup:’Situação do SRC’ no canto inferior direito da barra de situação.

  3. Turn OTF on by default, by selecting the CRS tab of the Options dialog and selecting checkbox Enable ‘on the fly’ reprojection by default.

If you have already loaded a layer, and want to enable OTF projection, the best practice is to open the Coordinate Reference System menu of the Project Properties dialog, select a CRS, and activate the checkbox Enable on the fly CRS transformation checkbox. The geographic CRS status icon will no longer be greyed-out and all layers will be OTF projected to the CRS shown next to the icon.

Figure Projection 2:


Project Properties Dialog nix

The Coordinate Reference System menu of the Project Properties dialog contains five important components as shown in Figure_projection_2 and described below.

  1. Enable on the fly CRS transformation - this checkbox is used to enable or disable OTF projection. When off, each layer is drawn using the coordinates as read from the data source and the components described below are inactive. When on, the coordinates in each layer are projected to the coordinate reference system defined for the map canvas.
  2. Coordinate Reference System - this is a list of all CRS supported by QGIS, including Geographic, Projected and Custom coordinate reference systems. To define a CRS, select it from the list by expanding the appropriate node and selecting the CRS. The active CRS is preselected.
  3. Proj4text - este é o string SRC usado pelo mecanismo de projeção Proj4. Este texto é somente leitura e fornecido apenas com propósito de informação.

  4. Filter - if you know the EPSG code, the identifier or the name for a Coordinate Reference System, you can use the search feature to find it. Enter the EPSG code, the identifier or the name.
  5. SRCs recentemente usados - se você tem SRCs que costuma usar em seus trabalhos de diários de SIG, estes serão mostrados na tabela abaixo do Diálogo de Projeções. Clique em um destes abaixo para selecionar o SRC associado.


Diálogo Propriedades do Projeto

If you open the Project Properties dialog from the Project (Gnome, OSX) or Settings (KDE, Windows) menu, you must click on the CRS menu to view the Coordinate Reference System settings.

The geographic CRS status icon will also automatically bring the CRS menu to the front.

Sistema de Referência de Coordenadas Personalizado

If QGIS does not provide the coordinate reference system you need, you can define a custom CRS. To define a CRS, select mActionCustomProjection Custom CRS from the Settings menu. Custom CRS are stored in your QGIS user database. In addition to your custom CRS, this database also contains your spatial bookmarks and other custom data.

Figure Projection 3:


Custom CRS Dialog nix

Defining a custom CRS in QGIS requires a good understanding of the Proj.4 projection library. To begin, refer to the Cartographic Projection Procedures for the UNIX Environment - A User’s Manual by Gerald I. Evenden, U.S. Geological Survey Open-File Report 90-284, 1990 (available at ftp://ftp.remotesensing.org/proj/OF90-284.pdf ).

This manual describes the use of the proj.4 and related command line utilities. The cartographic parameters used with proj.4 are described in the user manual and are the same as those used by QGIS.

A caixa de diálogo :guilabel:’Definição de um Sistema de Referência de Coordenadas Personalizado’ requer somente dois parâmetros para definir um SRC personalizado:

  1. um nome descritivo e

  2. o parâmetro cartográfico no formato PROJ.4.

Para criar um novo SRC, clique no botão mIconNew :sup:’Novo’ e entre com um nome descritivo e os parâmetros do SRC. Depois disso você pode salvar sei SRC clicando no botão mActionFileSave :sup:’Salvar’.

Observe que o item :guilabel:’Parâmetros’ deve começar com um bloco +proj=, para representar o novo sistema de referência de coordenadas.

Você pode testar seus parâmetros SRC para ver se eles dão resultados razoáveis clicando no botão [Calcular] dentro do bloco :guilabel:’Teste’ e colando seus parâmetros de SRC no campo :guilabel:’Parâmetros’. Depois entre com um valor conhecido de latitude e longitude em WGS 84 nos campos :guilabel:’Norte’ e guilabel:’Leste’ respectivamente. Clique em [Calculate] e compare os resultados com os valores conhecidos em seus sistema de referência de coordenadas.