QGIS as OGC Data Client¶
O Open Geospatial Consortium (OGC) é uma organização internacional com mais de 300 membros como entidades comerciais, sem fins lucrativos e de investigação distribuídos por todo mundo. Os membros desenvolvem e implementam standards para conteúdos e serviços geoespaciais, processamento e troca de dados SIG.
Describing a basic data model for geographic features, an increasing number of specifications are developed by OGC to serve specific needs for interoperable location and geospatial technology, including GIS. Further information can be found at https://www.opengeospatial.org/.
Important OGC specifications supported by QGIS are:
WMS — Serviço de Mapas Web (Cliente WMS/WMTS)
WMTS — Serviço de Mosaicos de Mapa Web (Cliente WMS/WMTS)
WFS — Serviços de Elementos Web (Cliente WFS e WFS-T)
WFS-T — Serviços de Elementos Web - Transacionais (Cliente WFS e WFS-T)
WCS — Serviços de Cobertura Web (Cliente WCS)
WPS — Web Processing Service
CSW — Catalog Service for the Web
SFS — Elementos Simples para SQL (PostGIS Layers)
GML — Linguagem de Marcadores Geográfico
OGC services are increasingly being used to exchange geospatial data between different GIS implementations and data stores. QGIS can deal with the above specifications as a client, being SFS (through support of the PostgreSQL / PostGIS data provider, see section PostGIS Layers).
Cliente WMS/WMTS¶
Visão Geral do Suporte WMS¶
QGIS currently can act as a WMS client that understands WMS 1.1, 1.1.1 and 1.3 servers. In particular, it has been tested against publicly accessible servers such as DEMIS.
A WMS server acts upon requests by the client (e.g., QGIS) for a raster map with a given extent, set of layers, symbolization style, and transparency. The WMS server then consults its local data sources, rasterizes the map, and sends it back to the client in a raster format. For QGIS, this format would typically be JPEG or PNG.
WMS is generically a REST (Representational State Transfer) service rather than a full-blown Web service. As such, you can actually take the URLs generated by QGIS and use them in a web browser to retrieve the same images that QGIS uses internally. This can be useful for troubleshooting, as there are several brands of WMS server on the market and they all have their own interpretation of the WMS standard.
As camadas WMS podem ser adicionadas facilmente, desde que saiba o URL de acesso ao servidor WMS, tenha uma ligação capaz a esse servidor, e que o servidor use HTTP como um mecanismo de transferência de dados.
Additionally, QGIS will cache your WMS responses (i.e. images) for 24h as long as the GetCapabilities request is not triggered. The GetCapabilities request is triggered everytime the Connect button in the Add Layer(s) from WMS(T) Server dialog is used to retrieve the WMS server capabilities. This is an automatic feature meant to optimize project loading time. If a project is saved with a WMS layer, the corresponding WMS tiles will be loaded from the cache the next time the project is opened as long as they are no older than 24H.
Visão Geral do Suporte WMTS¶
QGIS can also act as a WMTS client. WMTS is an OGC standard for distributing tile sets of geospatial data. This is a faster and more efficient way of distributing data than WMS because with WMTS, the tile sets are pre-generated, and the client only requests the transmission of the tiles, not their production. A WMS request typically involves both the generation and transmission of the data. A well-known example of a non-OGC standard for viewing tiled geospatial data is Google Maps.
De forma a exibir os dados a várias escalas aproximadas ao que o utilizador deseja ver, os conjuntos de mosaicos WMTS são produzidos a vários níveis de escala diferentes e são disponibilizados ao cliente SIG mediante pedido.
Este diagrama ilustra o conceito dos conjuntos de mosaicos

Conceito dos conjuntos de mosaicos WMTS¶
The two types of WMTS interfaces that QGIS supports are via Key-Value-Pairs (KVP) and RESTful. These two interfaces are different, and you need to specify them to QGIS differently.
In order to access a WMTS KVP service, a QGIS user must open the WMS/WMTS interface and add the following string to the URL of the WMTS tile service:
"?SERVICE=WMTS&REQUEST=GetCapabilities"
Um exemplo deste tipo de endereço é
https://opencache.statkart.no/gatekeeper/gk/gk.open_wmts?\ service=WMTS&request=GetCapabilities
A camada topo2 funciona lindamente para testar neste WMTS. Adicionando esta linha e texto indica que é um serviço web WMTS que deverá ser usado em vez de o serviço WMS.
O serviço WMTS RESTful torna-se uma forma diferente, é um URL simples, a forma recomendada pela OGC é:
{WMTSBaseURL}/1.0.0/WMTSCapabilities.xml
This format helps you to recognize that it is a RESTful address. A RESTful WMTS is accessed in QGIS by simply adding its address in the WMS setup in the URL field of the form. An example of this type of address for the case of an Austrian basemap is https://maps.wien.gv.at/basemap/1.0.0/WMTSCapabilities.xml.
Nota
You can still find some old services called WMS-C. These services are quite similar
to WMTS (i.e., same purpose but working a little bit differently). You can manage
them the same as you do WMTS services. Just add ?tiled=true
at the end
of the url. See https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification for more
information about this specification.
Quando lê o WMTS pode muitas vezes pensar em WMS-C.
Seleccionar Servidores WMS/WMTS¶
The first time you use the WMS feature in QGIS, there are no servers defined.
Begin by clicking the Add WMS layer button on the
toolbar, or selecting .
The dialog Add Layer(s) from a Server for adding layers from the WMS server appears. You can add some servers to play with by clicking the Add Default Servers button. This will add two WMS demo servers for you to use: the WMS servers of the DM Solutions Group and Lizardtech. To define a new WMS server in the Layers tab, select the New button. Then enter the parameters to connect to your desired WMS server, as listed in table_OGC_wms:
Tabela 1 OGC : Parâmetros de Ligação WMS
If you need to set up a proxy server to be able to receive WMS services from the
internet, you can add your proxy server in the options. Choose
Network & Proxy tab.
There, you can add your proxy settings and enable them by setting
Use proxy for web access. Make sure that you select the correct
proxy type from the Proxy type
drop-down menu.
Once the new WMS server connection has been created, it will be preserved for future QGIS sessions.
Dica
Em URLs de Servidores WMS
Certifique-se, que quando introduzir o URL do servidor WMS, seja o URL base. Por exemplo, não deve ter fragmentos como request=GetCapabilities
ou version=1.0.0
no seu URL.
Aviso
Entering username and password in the Authentication tab will keep unprotected credentials in the connection configuration. Those credentials will be visible if, for instance, you shared the project file with someone. Therefore, it’s advisable to save your credentials in a Authentication configuration instead (configurations tab). See Sistema de Autenticação for more details.
Carregar camadas WMS/WMTS¶
Once you have successfully filled in your parameters, you can use the Connect button to retrieve the capabilities of the selected server. This includes the image encoding, layers, layer styles and projections. Since this is a network operation, the speed of the response depends on the quality of your network connection to the WMS server. While downloading data from the WMS server, the download progress is visualized in the lower left of the WMS dialog.
Your screen should now look a bit like figure_OGC_add_wms, which shows the response provided by the European Soil Portal WMS server.

Dialog for adding a WMS server, showing its available layers¶
Codificação da Imagem
A secção Codificação de Imagem agora apresenta uma lista de formatos suportados pelo cliente e servidor. Escolha de acordo com as exigências de precisão da sua imagem.
Dica
Codificação da Imagem
Descobrirá que tipicamente os servidores WMS permitem a escolha da codificação de imagem em JPEG ou PNG. O JPEG é um formato comprimido com perda de informação, enquanto que o PNG reproduz fielmente os dados matriciais originais.
Use JPEG se espera dados WMS para fotografia na natureza e/ou não se importa da perda de alguma qualidade na imagem. Este típico trade.off reduz em 5 vezes o requerimento de transferência comparado ao PNG.
Use o PNG se necessitar representações precisas dos dados originais, e não se importa dos requerimentos de transferência de dados.
Opções
O campo Opções fornece um campo de texto onde pode adicionar Nome da Camada para a camada WMS. Este nome irá ser apresentado na legenda após carregamento da camada.
Em baixo do nome da camada pode definir Tamanho do mosaico, se quiser configurar os tamanhos do mosaico (ex.: 256x256) para dividir o pedido do WMS em pedidos múltiplos.
O Limite de elementos para GetFeatureInfo define quais os elementos do servidor a consultar.
If you select a WMS from the list, a field with the default projection provided by the mapserver appears. If the Change… button is active, you can click on it and change the default projection of the WMS to another CRS provided by the WMS server.
Por fim, caso o servidor WMS suporte esta funcionalidade, pode activar Use contextual WMS-Legend. Assim, apenas apenas será mostradas a parte da legenda relevante para a extensão actual do mapa e não são incluído itens da legenda que não sejam visíveis no mapa actual.
Ordem das Camadas
O separador Ordem de Camada tem uma lista das camadas seleccionadas disponíveis do WMS actual ligado. Poderá reparar que algumas camadas expansíveis, isto significa que a camada pode ser exibida na escolha dos estilos de imagem.
You can select several layers at once, but only one image style per layer. When several layers are selected, they will be combined at the WMS server and transmitted to QGIS in one go.
Dica
Ordenar Camadas WMS
As camadas WMS renderizadas por um servidor são sobrepostas na ordem da lista da secção de Camadas, de cima para baixo da lista. Se quiser alterar a ordem de sobreposição, pode usar o separador Ordem de camadas.
Transparência
In this version of QGIS, the Global transparency setting from the Layer Properties is hard coded to be always on, where available.
Dica
Transparência em Camada WMS
A disponibilidade de transparência da imagem do WMS depende da codificação da imagem usada: PNG e GIF suportam transparência, enquanto que o JPEG não suporta.
Sistema de Referência de Coordenadas
A coordinate reference system (CRS) is the OGC terminology for a QGIS projection.
Cada Camada WMS pode ser apresentada em múltiplos SRC, depedendo da capacidade do servidor WMS.
To choose a CRS, select Change… and a dialog similar to Custom CRS Dialog will appear. The main difference with the WMS version of the dialog is that only those CRSs supported by the WMS server will be shown.
Pesquisar servidor¶
Within QGIS, you can search for WMS servers. Figure_OGC_search shows the Server Search tab with the Add Layer(s) from a Server dialog.

Dialog for searching WMS servers after some keywords¶
As you can see, it is possible to enter a search string in the text field and hit the Search button. After a short while, the search result will be populated into the list below the text field. Browse the result list and inspect your search results within the table. To visualize the results, select a table entry, press the Add Selected Row to WMS List button and change back to the Layers tab. QGIS has automatically updated your server list, and the selected search result is already enabled in the list of saved WMS servers in the Layers tab. You only need to request the list of layers by clicking the Connect button. This option is quite handy when you want to search maps by specific keywords.
Basicamente esta opção é um frontend para a API do http://geopole.org.
Mosaicos¶
Ao usar Serviços WMTS (WMS em cache) como
https://opencache.statkart.no/gatekeeper/gk/gk.open_wmts?\
service=WMTS&request=GetCapabilities
you are able to browse through the Tilesets tab given by the server.
Additional information like tile size, formats and supported CRS are listed in
this table. In combination with this feature, you can use the tile scale slider
by selecting ( or ), then choosing Tile Scale Panel. This gives you the
available scales from the tile server with a nice slider docked in.
Usar a Ferramenta Identificar¶
Once you have added a WMS server, and if any layer from a WMS server is queryable,
you can then use the Identify tool to select a pixel on
the map canvas. A query is made to the WMS server for each selection made.
The results of the query are returned in plain text. The formatting of this text
is dependent on the particular WMS server used.
Selecção do formato
Se múltiplos formatos são suportados pelo servidor, uma caixa de combinação com os formatos suportados é automaticamente adicionado aos resultados da janela de identificação e o formato seleccionado irá armazenar no projecto para a camada.
Suporte do formato GML
The Identify tool supports WMS server response
(GetFeatureInfo) in GML format (it is called Feature in the QGIS GUI in this context).
If «Feature» format is supported by the server and selected, results of the Identify
tool are vector features, as from a regular vector layer. When a single feature
is selected in the tree, it is highlighted in the map and it can be copied to
the clipboard and pasted to another vector layer. See the example setup of the
UMN Mapserver below to support GetFeatureInfo in GML format.
# in layer METADATA add which fields should be included and define geometry (example):
"gml_include_items" "all"
"ows_geometries" "mygeom"
"ows_mygeom_type" "polygon"
# Then there are two possibilities/formats available, see a) and b):
# a) basic (output is generated by Mapserver and does not contain XSD)
# in WEB METADATA define formats (example):
"wms_getfeatureinfo_formatlist" "application/vnd.ogc.gml,text/html"
# b) using OGR (output is generated by OGR, it is send as multipart and contains XSD)
# in MAP define OUTPUTFORMAT (example):
OUTPUTFORMAT
NAME "OGRGML"
MIMETYPE "ogr/gml"
DRIVER "OGR/GML"
FORMATOPTION "FORM=multipart"
END
# in WEB METADATA define formats (example):
"wms_getfeatureinfo_formatlist" "OGRGML,text/html"
Propriedades de Visualização
Uma vez ter adicionado o servidor WMS, pode ver as suas propriedades clicando com o direito do rato na legenda, e seleccionando
.Separador dos Metadados
O separador Metadados exibem a riqueza de informação sobre o servidor WMS, geralmente recolhidos a partir da declaração de de Capacidades devolvidos a partir desse servidor. Muitas das definições podem ser removidas através da leitura dos padrões WMS (veja OPEN-GEOSPATIAL-CONSORTIUM Literatura e Referências Web), mas aqui estão algumas definições uteis:
Propriedades do Servidor
Versão do WMS — Versão do WMS suportada pelo servidor.
Image Formats — The list of MIME-types the server can respond with when drawing the map. QGIS supports whatever formats the underlying Qt libraries were built with, which is typically at least
image/png
andimage/jpeg
.Identity Formats — The list of MIME-types the server can respond with when you use the Identify tool. Currently, QGIS supports the
text-plain
type.
Propriedades da Camada
Seleccionado — Se esta camada foi ou não seleccionada quando o servidor foi adicionado a este projecto.
Visible — Whether or not this layer is selected as visible in the legend (not yet used in this version of QGIS).
Pode Identificar — Se a camada retorna ou não resultados quando a ferramenta Identificar é usada.
Can be Transparent — Whether or not this layer can be rendered with transparency. This version of QGIS will always use transparency if this is
Yes
and the image encoding supports transparency.Can Zoom In — Whether or not this layer can be zoomed in by the server. This version of QGIS assumes all WMS layers have this set to
Yes
. Deficient layers may be rendered strangely.Contagem em cascata — Os servidores WMS podem funcionar como proxies de outros servidores WMS de forma a obter dados matriciais para uma camada. Este campo mostra quantas vezes o pedido desta camada é redireccionado por outros servidores WMS para obter um resultado.
Fixed Width, Fixed Height — Whether or not this layer has fixed source pixel dimensions. This version of QGIS assumes all WMS layers have this set to nothing. Deficient layers may be rendered strangely.
WGS 84 Bounding Box — The bounding box of the layer, in WGS 84 coordinates. Some WMS servers do not set this correctly (e.g., UTM coordinates are used instead). If this is the case, then the initial view of this layer may be rendered with a very “zoomed-out” appearance by QGIS. The WMS webmaster should be informed of this error, which they may know as the WMS XML elements
LatLonBoundingBox
,EX_GeographicBoundingBox
or the CRS:84BoundingBox
.SRC disponíveis — As projecções em que esta camada pode ser renderizada pelo servidor WMS. As mesmas encontram-se listadas no formato original WMS.
Disponível em estilo — Os estilos de imagem em que esta camada pode ser renderizada pelo servidor WMS.
Show WMS legend graphic in table of contents and layout¶
The QGIS WMS data provider is able to display a legend graphic in the table of contents” layer list and in the print layout. The WMS legend will be shown only if the WMS server has GetLegendGraphic capability and the layer has getCapability url specified, so you additionally have to select a styling for the layer.
Se a legendaGraphic estiver disponível, é exibido em baixo da camada. é pequeno e tem de clicar nele para este ser aberto na sua dimensão real (devido à limitação da arquitectura do QgsLegendInterface). Ao clicar na legenda da camada irá ser aberto uma moldura com a legenda na sua resolução completa.
In the print layout, the legend will be integrated at it’s original (downloaded) dimension. Resolution of the legend graphic can be set in the item properties under
to match your printing requirements.A legenda irá exibir informação de contexto baseada na sua escala actual. A legenda WMS será exibida apenas se o WMS tiver capacidade GetLegendGraphic e a camada tiver um url getCapability específico, possa que possa seleccionar um estilo.
Limitações do Cliente WMS¶
Not all possible WMS client functionality had been included in this version of QGIS. Some of the more noteworthy exceptions follow.
Editar Configurações da Camada WMS
Once you’ve completed the Add WMS layer procedure,
there is no way to change the settings. A work-around is to delete the layer
completely and start again.
Servidores WMS que Requerem Autenticação
Actualmente o acesso público e serviços WMS protegidos são suportados. Os servidores WMS protegidos podem ser acedidos pela autenticação pública. Pode adicionar credenciais (opcionais) quando adiciona o servidor WMS. Veja a secção Seleccionar Servidores WMS/WMTS para detalhes.
Dica
Aceder a camadas protegidas OGC
If you need to access secured layers with secured methods other than basic authentication, you can use InteProxy as a transparent proxy, which does support several authentication methods. More information can be found in the InteProxy manual at https://inteproxy.wald.intevation.org.
Dica
|qg| WMS Mapserver
Since Version 1.7.0, QGIS has its own implementation of a WMS 1.3.0 Mapserver. Read more about this in chapter QGIS as OGC Data Server.
Cliente WCS¶
O Web Coverage Service (WCS) fornece acesso a dados matriciais em formatos úteis a renderização no lado do cliente, como input a modelos científicos, e para outros clientes. O WCS pode ser comparado ao WFS e ao WMS. Enquanto instâncias de WMS e WFS, o WCS permite aos clientes escolher porções de informação guardada num servidor com base em condicionantes espaciais e outros critérios de consulta.
QGIS has a native WCS provider and supports both version 1.0 and 1.1 (which are significantly different), but currently it prefers 1.0, because 1.1 has many issues (i.e., each server implements it in a different way with various particularities).
The native WCS provider handles all network requests and uses all standard QGIS network settings (especially proxy). It is also possible to select cache mode (“always cache”, “prefer cache”, “prefer network”, “always network”), and the provider also supports selection of time position, if temporal domain is offered by the server.
Aviso
Entering username and password in the Authentication tab will keep unprotected credentials in the connection configuration. Those credentials will be visible if, for instance, you shared the project file with someone. Therefore, it’s advisable to save your credentials in a Authentication configuration instead (configurations tab). See Sistema de Autenticação for more details.
Cliente WFS e WFS-T¶
In QGIS, a WFS layer behaves pretty much like any other vector layer. You can identify and select features, and view the attribute table. Since QGIS 1.6, editing WFS-T is also supported.
De uma forma geral adicionar uma camada WFS é muito semlehante ao procedimento usado com o WMS. A diferença é que não existe servidores padrões definidos, portanto nós teremos de adicionar o nosso.
Carregar uma camada WFS
As an example, we use the Gateway Geomatics WFS server and display a layer. https://demo.gatewaygeomatics.com/cgi-bin/wfs_gateway?REQUEST=GetCapabilities&VERSION=1.0.0&SERVICE=WFS
To be able to load a WFS Layer we create a connection to the WFS server first.
Open the Data Source Manager dialog by pressing the
Open Data Source Manager button
Click on New… to open the Create a New WFS Connection dialog
Enter
Gateway Geomatics
as nameEnter the URL (see above)
Creating a connection to a WFS server¶
In the WFS settings dialog, you can:
Indicate the WFS version of the server. If unknown, press the Detect button to automatically retrieve it.
Define the maximum number of features retrieved in a single GetFetFeature request. If empty, no limit is set.
Invert axis orientation.
And depending on the WFS version:
Force to Ignore axis orientation (WFS 1.1/WFS 2.0)
Enable feature paging and specify the maximum number of features to retrieve with Page size. If no limit is defined, then the server default is applied.
Aviso
Entering username and password in the Authentication tab will keep unprotected credentials in the connection configuration. Those credentials will be visible if, for instance, you shared the project file with someone. Therefore, it’s advisable to save your credentials in an Authentication configuration instead (Configurations tab). See Sistema de Autenticação for more details.
Press OK to create the connection.
Repare que as configurações proxy que definiu nas suas preferências são também reconhecidas.
Now we are ready to load WFS layers from the above connection.
Choose “Gateway Geomatics” from the Server Connections
drop-down list.
Click Connect
Select the Parks layer in the list
You can also choose whether to:
Click Add to add the layer to the map.

Adding a WFS layer¶
You’ll notice the download progress is visualized in the lower left of the QGIS main window. Once the layer is loaded, you can identify and select a couple of features and view the attribute table.
Nota
QGIS supports different versions of the WFS protocol, with background download and progressive rendering, on-disk caching of downloaded features and version autodetection.
Dica
Procurar Servidores WFS
You can find additional WFS servers by using Google or your favourite search engine. There are a number of lists with public URLs, some of them maintained and some not.