On Mon, Jul 17, 2023 at 3:03 PM Jakob Miksch via QGIS-User < [email protected]> wrote:
> Hello everyone, > > > > To my knowledge it is only possible to change a QGIS server project via > the QGIS desktop GUI. However, I would like to dynamically add or remove > layers in a QGIS server project. > > > > Is there or has there been any approach to accomplish this? > > My spontaneous idea is to use pyQGIS to edit the QGIS server project > directly without using the GUI, but maybe other approaches exist. I would > be grateful for any experiences, ideas or hints. > > > > Thanks, and best regards, > > Jakob > Hi, you can change a project in memory on each request using server plugins: https://docs.qgis.org/3.28/en/docs/pyqgis_developer_cookbook/server.html, the project is accessible via QgsProject.instance(). If you want a permanent change to the project you need to rewrite the project XML on the storage. Kind regards > > > > Jakob Miksch > Consultant > > +49 170 9036956 > siticom.online > > > > siticom GmbH • Werner-von-Siemens-Straße 2-6 • 76646 Bruchsal • Deutschland > Geschäftsführer: Jürgen Hatzipantelis, Stefan Höltken > Sitz der Gesellschaft: Weiterstadt • Amtsgericht Darmstadt • HRB 9276 > Umsatzsteuer-ID Nr.: DE 197 925 589 > > > _______________________________________________ > QGIS-User mailing list > [email protected] > List info: https://lists.osgeo.org/mailman/listinfo/qgis-user > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user > -- Alessandro Pasotti QCooperative: www.qcooperative.net ItOpen: www.itopen.it
_______________________________________________ QGIS-User mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
