-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Milestone
Description
Adding vector layers to a QGIS project file works as expected. But they are not published as WFS in the QGIS Server settings. See screenshot below.
Is it possible to use the QSA API to publish a vector layer as WFS in the QGIS Server settings block?
relevant links:
- https://gis.stackexchange.com/questions/362890/publishing-a-layer-as-wfs-with-pyqgis
- https://gis.stackexchange.com/questions/412953/read-wfs-layers-with-pyqgis
I hacked together this function which might be useful:
# get published WFS layers
wfsLayers, ok = QgsProject.instance().readListEntry('WFSLayers', '/')
print('wfs_layers', wfsLayers)
# set published WFS layers
def set_wfs_layers(qgis_project_instance, layer_ids):
qgis_project_instance.writeEntry( "WFSLayers" , "/", layer_ids)
geometry_precision = 8
for layer_id in layer_ids:
qgis_project_instance.writeEntry( "WFSLayersPrecision", "/" + layer_id, geometry_precision)
qgis_project_instance.write()
- demo implemenation: siticom@fa47909
Metadata
Metadata
Assignees
Labels
No labels