TransWikia.com

Programmatically press the "select all" button in WFS capabilities of QGIS project properties with Python

Geographic Information Systems Asked by Pivi on September 11, 2020

I would like to ask if someone knows a way to press the "select all" button in Project>Properties>QGIS Server>WFS capabilities using python, or if is there a specific command to do the same thing.

One Answer

Try the following

vectorLayers = [layer.id() for layer in QgsProject.instance().mapLayers().values() if isinstance(layer, QgsVectorLayer)]
QgsProject.instance().writeEntry( "WFSLayers" , "/", vectorLayers);
QgsProject.instance().write()

Adapted from my previous answer Publishing a layer as WFS with PyQGIS

Answered by ThomasG77 on September 11, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP