Accessing WMS-C layers in QuantumGIS.

Starting with version 1.5.0, QGIS is able to interpret WMS-C streams (development done by the Camptocamp company mandated by IGN for the project EDUGéO). This feature makes it possible to connect to WMS-C streams of the Geoportal ... if there was no GeoDRM! Under the project EDUGéO, this development has helped to get a python plugin for the GeoDRM. This page is therefore for the users of data outside EDUGéO project wishing to get connected to the WMS-C streams of the Geoportal in QGIS. It is important to remember that only commercial and INSPIRE API contracts can use this feature. This how-to is valid for all operating systems that run QuantumGIS and Java.

Principle

Connecting to Geoportal WMS-C servers via QGIS requires the use of a proxy for the token recovery according to the API key.

Methodology

  • Download these two files :

    geodrm-wrapper.jar : proxy

    wrapper-config-wmsc.xml : configuration file

  • Edit and modify the configuration file :
    <?xml version="1.0"?>
    <wrapper>
      <!--proxy>
        <host></host>
        <port></port>
      </proxy-->
      <remoteServices>
        <remoteService>
          <localHost>localhost</localHost>
          <localPort>10001</localPort>
          <localPath>/wmsc</localPath>
          <remoteHost>wxs.ign.fr</remoteHost>
          <remotePort>80</remotePort>
          <remotePath>/geoportail/wmsc</remotePath>
          <tokenProviderUrl>http://jeton-api.ign.fr/getToken</tokenProviderUrl>
          <apiKey></apiKey>
          <tokenLifeTime>600</tokenLifeTime>
        </remoteService>
      </remoteServices>
    </wrapper>
    • apiKey parameter : copy-paste there the API key ;
    • host and port parameters : to be uncommented and completed if necessary (e.g. corporate proxy) ;
    • localHost, localPort and localPath parameters : designate the url for connecting to the service from QGIS ;
    • remoteHost, remotePort and remotePath parameters : designate the URL of WMS-C Geoportal infrastructure ;
    • tokenProviderUrl parameter : designate the URL of the token service of the Geoportal infrastructure.
  • In a console, run the following command in the folder containing the two previous files :
    java -jar geodrm-wrapper.jar wrapper-config-wmsc.xml

    Information messages indicate when a successful connection.

    2010-08-24 08:54:54.354::INFO:  Logging to STDERR via org.mortbay.log.StdErrLog
    2010-08-24 08:54:54.413::INFO:  jetty-1.0.0-SNAPSHOT
    2010-08-24 08:54:55.623::INFO:  Started BlockingChannelConnector@localhost:10001
  • In QGIS, open a WMS connection :
    • In the "Layer" menu, click a layer <Add WMS>;
    • In the "Layers" tab, click on the New button and fill ther form according to the parameters passed in the configuration file. Validate :
  • In the drop-down menu, select the server created earlier, and click the button connection>. After a few seconds of waiting, the connection is established; Don't forget to hit "No" when QGIS asks for choosing or not the URL advertised in the capabilities !
  • In the tilesets tab, select the layer to add. Click on the button Add. The dataset is then displayed in QGIS.

User-defined EPSG codes

The WMS-C service exposes Geoportail's projections as EPSG user-defined codes in order to comply with the WMS-C's underlaying standard : WMS 1.1.1. This change (from 9th of May 2011) implies to keyin these codes into QGIS :

  • Open Settings or Edit menu and select Custom CRS option ;
  • In the proposed tab :
    • Enter the user-defined code name into the "Name" field ;
    • Enter the user-defined code PROJ.4 definition into the "Parameters" field ;
    • Hit "Save".

The CRS can now be chosen as the project's default projection.

Notes

  • During the connection to the Geoportail WMS-C catalog, QGIS presents all the layers provided by the service. However the visible layers will only be those which are allowed by the API key. So, some layers could be added in QGIS without the API key allows to display data then.
  • In case of problems for the configuration of the proxy, it is advisable to use a middle proxy between the proxy and the Geopotal WMS-C service, like paros.