3liz / py-qgis-server

QGIS embbeded WMS/WFS/WCS asynchronous scalable http server
https://docs.3liz.org/py-qgis-server
Mozilla Public License 2.0
68 stars 16 forks source link

Accept project stored in PostgreSQL Database #5

Closed rldhont closed 4 years ago

rldhont commented 5 years ago

In QGIS 3, it's possible to save the project to a PostgreSQL Database.

QGIS Server 3 is able to provide services based on a MAP with this type of encoded value postgresql:?service=pg_geotuga&sslmode=disable&dbname=&schema=ortos&project=teste

It could be interesting to have a way to defined a project stored in PostgreSQL Database.

for exemple, the PostgreSQL connexion for projects could be defined in a config file and the MAP parameter could be pg://schema/project

dmarteau commented 4 years ago

Actually, py-qgis-server supports the QGSRV_%s_PROTOCOL, where %s is replaced by whatever scheme used in a MAP - This is used in production for implementing WPS results uri. May be that could be used for declaring pg: scheme.

What I need to know, if that is implemented at QgsProject level or at cache config lever. In the later case, we have to (re)implement how to fetching those projects because we do not use the default cache config.

rldhont commented 4 years ago

It is implemented at the QgsProject level. The projectStorage method 1 used in read method 2 returns the QgsProjectStorage object associated to the pg: scheme in the QgsProjectStorageRegistry 3.

dmarteau commented 4 years ago

So, it is just a matter for pyqsserver to acknowledge this protocol.

rldhont commented 4 years ago

it has been implemented, isn't it?

dmarteau commented 4 years ago

Yes, commit a643f352af9e7749a9a909eac60baff868b557f5

lpofredc commented 4 years ago

Could it be possible to have some more informations about using QGIS projects stored in postgres DB with QgisServer and lizmap? Thanks

Gustry commented 4 years ago

@lpofredc Better to create an issue I think. And I don't think Lizmap config is supported, only QGIS Projects for now

dmarteau commented 4 years ago

@lpofredc This is not supported in Lizmap yet.