QGIS as OGC Data Client

A Open Geospatial Consortium (OGC), é uma organização internacional com mais de 300 organizações comerciais, governamentais, sem fins lucrativos e de pesquisa em todo o mundo. Seus membros desenvolvem e implementam normas para conteúdo geoespacial e de serviços, processamento de dados SIG e intercâmbio.

Descrevendo um modelo de dados básico para feições geográficas de um número crescente de especificações são desenvolvidos para atender necessidades específicas de localização interoperabilidade ​​e tecnologia geoespacial, incluindo SIG. Mais informações podem ser encontradas em http://www.opengeospatial.org/.

Important OGC specifications supported by QGIS are:

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 Camadas PostGIS).

WMS/WMTS Client

Resumo do suporte WMS

QGIS currently can act as a WMS client that understands WMS 1.1, 1.1.1 and 1.3 servers. It has particularly been tested against publicly accessible servers such as DEMIS.

WMS servers act 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 would typically be JPEG or PNG.

WMS is generically a REST (Representational State Transfer) service rather than a fully-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 servers in the market and they all have their own interpretation of the WMS standard.

Camadas WMS podem ser adicionadas simplesmente, desde que você saiba a URL para acessar o servidor WMS, você tem uma conexão útil para esse servidor, e o servidor HTTP entende como mecanismo de transporte de dados.

Overview of WMTS Support

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 a 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 and 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.

In order to display the data at a variety of scales close to what the user might want, the WMTS tile sets are produced at several different scale levels and are made available for the GIS client to request them.

This diagram illustrates the concept of tile sets:

Figure WMTS 1:

../../../_images/concept_wmts.png

Concept of WMTS tile sets

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.

1) In order to access a WMTS KVP service, a QGIS user opens the WMS/WMTS interface and adds the following string to the URL of the WMTS tile service:

"?SERVICE=WMTS&REQUEST=GetCapabilities"

An example of this type of address is

http://opencache.statkart.no/gatekeeper/gk/gk.open_wmts?\
  service=WMTS&request=GetCapabilities

For testing the topo2 layer in this WMTS works nicely. Adding this string indicates that a WMTS web service is to be used instead of a WMS service

2) The RESTful WMTS service takes a different form, it is a straightforward URL, the format recommended by the OGC is:

{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 for an Austrian basemap of this type of address is http://maps.wien.gv.at/basemap/1.0.0/WMTSCapabilities.xml

Nota

You can find some old service call WMS-C. Thoses services are quiet similar to WMTS service same purpose but working a little bit differently). You can manage them as the same way you do it for WMTS services. Just add ?tiled=true at the end of the url. See http://wiki.osgeo.org/wiki/Tile_Map_Service_Specification for more information about this specification.

When you read WMTS you can often think WMS-C also.

Selecting WMS/WMTS Servers

A primeira vez que você usar o recurso de WMS, não há servidores definidos.

Comece clicando no mActionAddWmsLayer: sup: botão Adicionar camada WMS dentro da barra de ferramentas, ou através do :menuselection: menu Camada –> Adicionar Camada WMS ....

O diálogo: guilabel: ‘Adicionar camada(s) de um servidor` para adicionar camadas do servidor WMS aparecerá. Você pode adicionar alguns servidores para jogar clicando no botão [Adicionar servidores padrões] Isto irá adicionar dois servidores de demonstração de WMS para você usar, os servidores WMS do DM Solutions Gmap e Lizardtech server. Para definir um servidor WMS novo no guia: guilabel: Camadas, selecione o botão [Novo]. Em seguida, insira os parâmetros para se conectar ao servidor WMS desejado, conforme listado na table_OGC_1:

Nome

Um nome para essa conecção. Este nome será usado nas conexões de servidor caixa suspensa para que você possa distingui-lo de outros servidores WMS.

URL

URL do servidor que fornece os dados. Este deve ser um nome de host resolvido, o mesmo formato que você usaria para abrir uma conexão telnet ou ping em um host.

Usuário

Usuário para o acesso em servidor WMS seguro. Este parâmetro é opcional.

Senha

Senha para uma autenticação básica no servidor WMS. Este parâmetro é opcional.

Ignorar GetMap URI

checkbox Ignorar GetMap URI relatados em recursos, usar determinado URI do campo URL acima.

Ignorar GetFeatureInfo URI relatados em recursos

checkbox Ignorar GetMap URI relatados em recursos , usar determinado URI do campo URL acima

Tabela OGC 1: Parâmtros de coneçã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 menu Settings ‣ Options and click on the tab Network & Proxy. There you can add your proxy-settings and enable them by setting the checkbox Use proxy for web access. Make sure that you select the correct proxy type from the Proxy type selectstring dropdown menu.

Once the new WMS Server connection has been created, it will be preserved for future QGIS sessions.

Dica

Nas URLs dos servidores WMS

Certifique-se, ao entrar na URL do servidor WMS, que você tem a URL base. Por exemplo, você não deve ter fragmentos pedidos, como request= GetCapabilities ou version=1.0.0 no seu URL.

Loading WMS/WMTS Layers

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 left bottom of the WMS dialog.

Sua tela deve agora visualizar como na figure_OGR_1, que mostra a resposta fornecida pelo servidor WMS DM Solutions GMap.

Figure OGR 1:

../../../_images/connection_wms.png

Dialog for adding a WMS server, showing its available layers nix

Codificação de imagem

A: guilabel: Codificação da Imagem a secção agora lista todos os formatos que são suportados pelo cliente e servidor. Escolha um de acordo com suas exigências de precisão de imagem.

Dica

Codificação de imagem

Você encontrará tipicamente que um servidor WMS oferece-lhe a escolha de codificação de imagem JPEG ou PNG. JPEG é um formato de compressão com perdas, enquanto PNG reproduz fielmente os dados raster bruto.

Use JPEG se você espera que os dados WMS sejam fotográficos na natureza e / ou você não se importa de alguma perda na qualidade da imagem. Este trade-off normalmente reduz em cinco vezes a necessidade de transferência de dados em comparação com PNG.

Use PNG, se você quiser representações precisas dos dados originais, e não se importa com o aumento dos requisitos de transferência de dados.

Opções

The Options field provides a text field where you can add a Layer name for the WMS-layer. This name will be presented in the legend after loading the layer.

Below the layer name you can define Tile size, if you want to set tile sizes (eg. 256x256) to split up the WMS request into multiple requests.

A: guilabel: Limite de feição para GetFeatureInfo define quais feições do servidor serão consultadas.

Se você selecionar um WMS da lista um campo com a projeção padrão, fornecido pelo mapserver, aparecerá. Se o botão [Mudar ...] estiver ativo, você pode clicar nele e mudar a projeção padrão do WMS para outro SRC, fornecidos pelo servidor WMS.

Ordem de camada

A guia: guilabel: Ordem de camada lista as camadas selecionadas disponíveis a partir do servidor WMS atual conectado. Você pode notar que algumas camadas são expansíveis, isso significa que a camada pode ser exibida em uma escolha de 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

Ordenação de camada WMS

Camadas WMS disponibilizadas por um servidor são sobrepostas na ordem listada na seção Camadas, de cima para baixo da lista. Se você quiser alterar a ordem de sobreposição, você pode usar a guia: guilabel: Ordem de camada.

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 da camada WMS

A disponibilidade de transparência da imagem WMS depende da codificação utilizada na imagem: PNG e GIF suportam transparência, enquanto JPEG deixa sem suporte.

Sistema de coordenada de referência

A Coordinate Reference System (CRS) is the OGC terminology for a QGIS Projection.

Each WMS Layer can be presented in multiple CRSs, depending on the capability of the WMS server.

To choose a CRS, select [Change...] and a dialog similar to Figure Projection 3 in Trabalhando com Projeções will appear. The main difference with the WMS version of the screen is that only those CRSs supported by the WMS Server will be shown.

Tilesets

When using WMTS (Cached WMS) Services like

http://opencache.statkart.no/gatekeeper/gk/gk.open_wmts?\
  service=WMTS&request=GetCapabilities

you are able to browse through the tab Tilesets 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 from the Settings ‣ Panels (KDE and Windows) or View ‣ Panels (Gnome and MacOSX) then choose Tile scale, which gives you the available scales from the tileserver with nice slider docked in.

Usando a ferramenta de identificação

Once you have added a WMS server, and if any layer from a WMS server is queryable, you can then use the mActionIdentify 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.

Format selection

If multiple output formats are supported by the server, a combo box with supported formats is automatically added to the identify results dialog and the selected format will is stored in project for the layer.

GML format support

The mActionIdentify Identify tool supports WMS server response (GetFeatureInfo) in GML (it is called Feature in QGIS GUI in this context) format. If “Feature” format is supported by the server and selected, results of the Identify tool are vector features like from regular vector layer. When a single feature is selected in the tree, it is highlighted in the map and it can be copied to clipboard and pasted to another vector layer. See example setup of UMN Mapserver below to support GetFeatureInfo 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"

Exibindo propriedades

Depois de ter adicionado um servidor WMS, você pode ver suas propriedades clicando sobre ela na legenda, e selecionando: menuselection: Propriedades.

Guia Metadata

The tab Metadata displays a wealth of information about the WMS server, generally collected from the Capabilities statement returned from that server. Many definitions can be cleaned by reading the WMS standards (see OPEN-GEOSPATIAL-CONSORTIUM Referências Bibliográficas e Web), but here are a few handy definitions:

  • Propriedades do servidor

    • Versão WMS — A versão 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 and image/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

    • Selecionado — Seja ou não essa camada foi selecionada quando o servidor foi adicionado a este projeto.

    • Visible — Whether or not this layer is selected as visible in the legend. (Not yet used in this version of QGIS.)
    • Pode identificar — ou não essa camada retornará nenhum resultado quando a ferramenta Identificar é usada nela.

    • 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.
    • Cascade Count — WMS servers can act as a proxy to other WMS servers to get the raster data for a layer. This entry shows how many times the request for this layer is forwarded to peer WMS servers for a result.
    • 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:84 BoundingBox.
    • SRC Disponível — As projeções que esta camada pode ser apresentadas pelo servidor WMS. Elas estão listadas no formato nativo WMS.

    • Estilo Disponível — Os estilos de imagem que esta camada pode renderizar pelo servidor WMS.

Limitações do cliente WMS

Not all possible WMS Client functionality had been included in this version of QGIS. Some of the more notable exceptions follow.

Editando configurações de camada WMS

Once you’ve completed the mActionAddWmsLayer Add WMS layer procedure, there is no ability to change the settings. A workaround is to delete the layer completely and start again.

Autenticação requerida nos servidores WMS

Atualmente públicas acessíveis e seguros os serviços-WMS são suportados. Os servidores-WMS seguros podem ser acessados ​​por meio da autenticação pública. Você pode adicionar as credenciais (opcional) quando você adiciona um servidor-WMS. Consulte a seção: ref: ogc-wms-servers para mais detalhes.

Dica

Acessando camadas-OGC seguras

If you need to access secured layers with other secured methods than basic authentication, you could use InteProxy as a transparent proxy, which does support several authentication methods. More information can be found at the InteProxy manual found on the website http://inteproxy.wald.intevation.org.

Dica

|qg| WMS Mapserver

From Version 1.7.0 QGIS has its own implementation of a WMS 1.3.0 Mapserver. Read more about this at chapter QGIS as OGC Data Server.

WCS Client

wcs A Web Coverage Service (WCS) provides access to raster data in forms that are useful for client-side rendering, as input into scientific models, and for other clients. The WCS may be compared to the WFS and the WMS. As WMS and WFS service instances, a WCS allows clients to choose portions of a server’s information holdings based on spatial constraints and other query criteria.

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, each server implements it in 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 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 server.

Clientes 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.

Em geral, a adição de uma camada WFS é muito semelhante ao procedimento utilizado com WMS. A diferença é que não há servidores padrão definidos, por isso temos de acrescentar o nosso.

Carregando uma camada WFS

Como exemplo, vamos usar o DM Solutions servidor WFS e exibir uma camada. A URL é: http://www2.dmsolutions.ca/cgi-bin/mswfs_gmap

  1. Clique no wfs: sup: ferramenta Adicionar Camada WFS na barra de ferramentas Camadas, o diálogo: guilabel: aparece ‘Adiciona camada WFS de um Servidor `

  2. Click em [Novo]

  3. Enter ‘DM Solutions’ as name
  4. Entre com a URL (ver acima citada)

  5. Clique [OK]

  6. Choose ‘DM Solutions’ from the dropdown list Server Connections selectstring
  7. Clique [Conectar]

  8. Aguarde a lista de camadas a ser preenchida

  9. Select the Parks layer in the list
  10. Clique [Aplicar] para adicionar a camada para o mapa

Note that proxy settings you have set in your preferences are also recognized.

Figure OGR 3:

../../../_images/connection_wfs.png

Adding a WFS layer nix

You’ll notice the download progress is visualized in the left bottom of the QGIS main window. Once the layer is loaded, you can identify and select a province or two and view the attribute table.

Only WFS 1.0.0 is supported. At this point there have not been many tests against WFS versions implemented in other WFS-servers. If you encounter problems with any other WFS-server, please do not hesitate to contact the development team. Please refer to Section Ajuda e Suporte for further information about the mailinglists.

Dica

Conclusão do servidor WFS

Você pode encontrar mais servidores WFS, usando o Google ou o seu motor de busca favorito. Há um número de listas com URLs públicas, algumas delas mantidas e algumas não.