QGIS mapserver

Home

What is it?

Download

Configuration

Documentation

Sample Requests

Development Team

Publications

Links

Configuration of the QGIS mapserver

Webserver

You need to have a webserver installed (e.g. Apache) and place the files for the QGIS mapserver in the FastCGI or CGI directory of your webserver. On Windows, QGIS mapserver currently can only be used as a CGI application. You also need to make sure the webserver finds libqgis_core.so/dll and libqgis_gui.so/dll and the Qt libraries when starting the server application.

For Apache this can achieved by extending the LD_LIBRARY_PATH in the webserver configuration file:

CGI

Enter the following line into apache2.conf:

SetEnv LD_LIBRARY_PATH <Path to Qt libraries>:<Path to QGIS libraries>

FastCGI

Enter the following line into fcgid.conf:

DefaultInitEnv LD_LIBRARY_PATH <Path to Qt libraries>:<Path to QGIS libraries>



Publish data with QGIS mapserver

The file 'admin.sld' is the configuration file where new data source can be entered. It uses (extended) SLD syntax to describe the available layers and their symbolisation. The different datasources can be entered as 'UserLayer' tags into admin.sld. Below a few examples:



shapefile

<StyledLayerDescriptor xmlns="http://www.opengis.net/sld">

<UserLayer>

<Name>wfslayer</Name>

<HostedVDS providerType="ogr" uri="/home/humarco/ndk/vector/Eu_lakes_gen.shp"/>

<UserStyle>

<Name>userstyle</Name>

<FeatureTypeStyle>

<Rule>

<PolygonSymbolizer>

<Stroke><sld:CssParameter sld:name="stroke">#0000ff</sld:CssParameter>

<sld:CssParameter sld:name="stroke-width">3</sld:CssParameter>

</Stroke>

<Fill>

<sld:CssParameter sld:name="fill">#0000ff</sld:CssParameter>

</Fill>

</PolygonSymbolizer>

</Rule>

</FeatureTypeStyle>

</UserStyle>

</UserLayer>

</StyledLayerDescriptor>



postgis database

similar to shapefile, but with

...

<HostedVDS providerType="postgres" uri="host=localhost dbname=test port=5432 user=postgres password=blabla table=mytable"/>

...



wfs

<StyledLayerDescriptor xmlns="http://www.opengis.net/sld">

<UserLayer>

<Name>wfslayer</Name>

<RemoteOWS>

<Service>WFS</Service>

<OnlineResource href="http://karlinapp.ethz.ch/cgi-bin/mapserv?map=/home/marco/mapfiles/mapfile1.map&amp;" type="states" />

</RemoteOWS>

<UserStyle>

<Name>userstyle</Name>

<FeatureTypeStyle>

<Rule>

<PolygonSymbolizer>

<Stroke><sld:CssParameter sld:name="stroke">#0000ff</sld:CssParameter>

<sld:CssParameter sld:name="stroke-width">3</sld:CssParameter>

</Stroke>

<Fill>

<sld:CssParameter sld:name="fill">#0000ff</sld:CssParameter>

</Fill>

</PolygonSymbolizer>

</Rule>

</FeatureTypeStyle>

</UserStyle>

</UserLayer>

</StyledLayerDescriptor>

top Last update 27 Jan 2009