1

I would like to create a short list of useful WMS layers for non-GIS specialists colleagues. The idea is to give them a document allowing them to configure their connections easily - either a XML that they can charge using "add wms layer", or a short python script to copy/paste in the console. Is there a way to achieve that in QGIS?

So far, I've only been able to either connect to a WMS service using XML, without being able to choose only the layers that my colleagues will actually use :

<!DOCTYPE connections>
<qgsWMSConnections version="1.0">
    <wms ignoreGetMapURI="false" smoothPixmapTransform="false" dpiMode="7" password="" ignoreGetFeatureInfoURI="false" referer="" username="" url="http://wms.craig.fr/mnt" invertAxisOrientation="false" ignoreAxisOrientation="false" name="[CRAIG] Modèles Numériques de Terrain : ombrage, couleur, courbes de niveau"/>
</qgsWMSConnections>

or to open specific layers using Python (see here for example) - but I don't want the layers to actually open, I only want them to show in the browser panel...

nmtoken
  • 13,355
  • 5
  • 38
  • 87
Mefimefi
  • 586
  • 1
  • 6
  • 19

2 Answers2

1

Probably the simplest way to do this is to set up a catalogue of your services, where the catalogue exposes a CSW interface, then use the built-in (QGIS 3) / Plugin (QGIS 2.n) MetaSearch tool to give a list of layers that your colleagues can choose from.

nmtoken
  • 13,355
  • 5
  • 38
  • 87
  • The services are not mine: they are official, already existing services. And unfortunately, too many of them give errors in MetaSearch (mismatched tags for example, like here https://gis.stackexchange.com/questions/275102/connection-error-with-qgis-3-0-metasearch-plugin) for the plugin to be really useful for me. – Mefimefi Jun 06 '18 at 12:49
  • You can create your own metadata catalogue. And add records from any dataset or services. You don't have to own the data or services – nmtoken Jun 06 '18 at 12:52
  • I was hoping for a more "out-of-the-box' kind of solution... but as it doesn't seem to exist, I'll give your suggestion a go. Thinking about using Geonetwork https://www.geonetwork-opensource.org/manuals/3.4.x/fr/tutorials/introduction/harvesting/index.html – Mefimefi Jun 07 '18 at 10:32
1

have a look at this, it can simply be modified for the use with WMS/WMTS Servers just change connections-xyz into connections-wms. zmax and zmin has to be empty.

https://raw.githubusercontent.com/klakar/QGIS_resources/master/collections/Geosupportsystem/python/qgis_basemaps.py

user133752
  • 11
  • 2
  • I finally managed to obtain what I wanted using Lizmap (I set up projects with a selection of layers in Lizmap and gave my colleagues the links to the Lizmap-generated WMS services). But I'll have a look at your solution when I have the chance. – Mefimefi Dec 18 '18 at 15:47