Servidor QGIS

O Servir QGIS é uma fonte aberta WMS 1.3 e WFS 1.0.0 que implementa, além disso, implementa avançados recursos cartográficos para mapeamento temático. O servidor do QGIS é um aplicativo FastCGI/CGI (Common Gateway Interface), escrito em C++ que funciona em conjunto com um servidor web (por exemplo, o Apache, Lighttpd). É financiado pela projeto Orchestra UE, Sany e a cidade de Uster, na Suíça.

It uses QGIS as backend for the GIS logic and for map rendering. Furthermore the Qt library is used for graphics and for platform independent C++ programming. In contrast to other WMS software, the QGIS Server uses cartographic rules as a configuration language, both for the server configuration and for the user-defined cartographic rules.

Além disso, o projeto do Servidor QGIS fornece o complemento ‘Publicar na Web’, um complemento para o QGIS desktop que exporta as camadas atuais e simbologia como um projeto web para o Servidor QGIS (contendo regras de visualização cartográfica expressas em SLD).

As QGIS desktop and QGIS Server use the same visualization libraries, the maps that are published on the web look the same as in desktop GIS. The ‘Publish to Web’ plugin currently supports basic symbolization, with more complex cartographic visualization rules introduced manually. As the configuration is performed with the SLD standard and its documented extensions, there is only one standardised language to learn, which greatly simplifies the complexity of creating maps for the Web.

Em um dos seguintes manuais vamos fornecer um exemplo de configuração para configurar um servidor de QGIS. Mas, por ora, recomendamos que você leia uma das seguintes URLs para obter mais informações:

Instalação simples no Squeeze Debian

Neste ponto, vamos dar um exemplo de instalação curto e simples para Squeeze Debian. Muitos outros sistemas operacionais também oferecem pacotes para o servidor QGIS. Se você tem que construir tudo a partir da fonte, por favor consulte as URLs acima.

Apart from qgis and qgis-mapserver you need a webserver, in our case apache2. You can install all packages with aptitude or apt-get install together with other necessary dependency packages. After installation you should test, if the webserver and qgis server works as expected. Make sure the apache server is running with /etc/init.d/apache2 start. Open a web browser and type URL: http://localhost. If apache is up, you should see the message ‘It works!’.

Now we test the qgis server installation. The qgis_mapserv.fcgi is available at /usr/lib/cgi-bin/qgis_mapserv.fcgi and provides a standard wms that shows the state boundaries of Alaska. Add the WMS with the URL http://localhost/cgi-bin/qgis_mapserv.fcgi as described in Selecionando servidor WMS.

Figure Server 1:

../../../_images/standard_wms_usa.png

Standard WMS with USA boundaries included in the qgis server (KDE) nix

Creating a WMS/WFS from a QGIS project

To provide a new qgis wms/wfs server we have to create a qgis project file with some data. Here we use the ‘alaska’ shapefile from the qgis_sample_dataset. Define the colors and styles of the layers in QGIS and define the project CRS, if not already done.

Figure Server 2:

../../../_images/ows_server_definition.png

Definitions for a qgis project WMS/WFS server (KDE)

Then open the OWS Server tab in the menu Settings ‣ Project Properties and define the general fields under ‘Service Capabilities’. For WMS Capabilities define ‘Coordinate System Restrictions’ and ‘Advertised Extend’. Additionally you can enable the checkbox checkbox Add WKT geometry to feature into response to make the layers queryable and add a ‘Maximum width’ and height that can be requested. For WFS Capabilities you only need to select the layers that you want to provide as WFS. Now save the session in a project file alaska.qgs. To provide the project as a WMS/WFS, we create a new folder /usr/lib/cgi-bin/project with admin privileges and add the project file alaska.qgs and a copy of the qgis_mapserv.fcgi file - that’s all.

Now we test our project WMS and WFS, add the WMS and WFS as described in Carregando camadas WMS and Clientes WFS e WFS-T to QGIS and load the WMS. The URL is:

http://localhost/cgi-bin/project/qgis_mapserv.fcgi