Trabalhando com Dados WMS¶
This tutorial is now obsolete. A new and updated version is available at Working with WMS Data (QGIS3)
Frequentemente você precisa de camadas de dados de referência para sua base de mapas ou para exibir seus resultados no contexto de outros conjuntos de dados. Muitas organizações publicam conjuntos de dados online que podem ser facilmente utilizados no QGIS. Um padrão popular para publicar mapas online é chamado WMS (Web Map Service). Esta é uma escolha melhor para utilizar camadas de referência a medida que você obtém acesso a ricos conjuntos de dados no seu QGIS sem o aborrecimento de baixar ou estilizar os dados.
Visão geral da tarefa¶
Neste tutorial, nós vamos carregar camadas de Mineral Resources publicadas por USGS.
Fonte de dados: [MRDATA]
Abra o QGIS e vá para :menu seleção:Camada–> Adicionar camada WMS….
No Layers aba, clique em New.
Name your connection. This is not the name of the layer but the name of service which is offering the WMS layer. A single service usually offers multiple layers that can be added to your project. The URL that you need to access a WMS layer is called GetCapabilities. When you access a WMS server with this parameter in the URL, it returns a list of layers available along with various metadata. In this case, name the connection as
MRDATA USGSand the GetCapabilities URL as
http://mrdata.usgs.gov/services/ca?request=getcapabilities&service=WMS&version=1.1.1&. Click OK.
Next, click on the Connect button to fetch the list of layers available. You will notice different IDs listed next to the layers. ID
0means you get a map of all the layers. If you do not want all the layers, you can expand the list by clicking on + icon and selecting the layer of interest. Select the layer
0for this tutorial.
In the Image encoding section, you need to choose an image format. Image formats matter a great deal and which one you choose depends on your use case. Here are some pointers
Quality: PNG is a lossless compressed image format. JPEG is lossy compressed format. TIFF can be either. That means the quality of PNG images will be better compared to JPEG. If your main purpose is to print a map, use PNG.
Speed: Since PNG images are uncompressed and thus larger in size, they will take longer to load. If you are using the layer in your project as a reference layer and need to zoom/pan a lot, use JPEG.
Client Support: QGIS supports most of the formats, but if you are developing web applications, browsers usually do not support TIFF, so you should choose another format.
Type of data: If your layers are primarily vector, PNG will give better results. For imagery layers, JPEG is usually a better choice.
For this tutorial, choose JPEG as the format. Change the Layer name if you wish and click Add.
You will see the layer loaded in the QGIS canvas. You can zoom/pan around just like any other layer. The way WMS service works is that every time you zoom/pan, it sends your viewport coordinates to the server and the server creates an image for that viewport and return it to the client. So there will be some delay before you see the image for the area after you have zoomed in. Also, since the data you see is an image, there is no way to query for attributes like in a regular vector/imagery layer.
You can, however, see some metadata about the layer. Right-click the layer and choose Properties.
You will notice that the Properties dialog looks different and has fewer tabs. You can go to the Metadata tab to learn more about the WMS service and the layers.