Skip to content

Publish added vector layers as WFS in QGIS Server #64

@JakobMiksch

Description

@JakobMiksch

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:

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()

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions