I've configured a WMS service on QGIS Server by using https://docs.qgis.org/3.16/en/docs/training_manual/qgis_server/wms.html and QGIS Server on a Windows machine -where do the qgs files go? but was trying to see how I can also serve WFS.

When I try 'http://localhost:8080/cgi-bin/qgis_mapserv.fcgi.exe' I get enter image description here enter image description here

WMS works fine using http://localhost:8080/cgi-bin/qgis_mapserv.fcgi.exe?map=C:%5Cpublic_ftp%5Cftpuser%5Cd%5CMGM%5CMapData%5Canimals.qgs

enter image description here

What do I need to setup to allow it to serve WFS?


You need to go in the menu "Project" > "Properties...", choose in the configuration the section about "QGIS Server". Then, go to section "WFS Capabilities" and tick layers you want to publish (see below screenshot)

At the moment, you did not tick any vector layers in your QGIS project, so that's why when you try to consume your WFS from localhost, you got the message "capabilities document contained no layers."

Set WFS Capabilities

Edit due to comment:

For enable editing (full), you need to also tick columns "Update", "Insert", "Delete" shown above in the screenshot and not only "Published" column

PS: infos from https://docs.qgis.org/3.16/en/docs/server_manual/getting_started.html#wfs-capabilities

  • Thanks - that worked and now I am wondering if it's possible to make the WFS features editable in QGIS?
    – GeorgeC
    Mar 17 '21 at 3:36
  • 1
    Updated the answer
    – ThomasG77
    Mar 17 '21 at 9:03
  • Can it also serve xyz tiles?
    – GeorgeC
    Mar 18 '21 at 0:28
  • Yes with WMTS (section WMTS Capabilities in the screenshot) but works well only with EPSG 3857 github.com/qgis/QGIS/issues/34826
    – ThomasG77
    Mar 18 '21 at 12:31
  • and what would the format of the request be https://server.com/path/{z}_{x}_{y}.png? What do we put in the 'Advertised URL` section?
    – GeorgeC
    Mar 22 '21 at 3:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.