Bug report #8172

[QGIS-Server] Initializing qgis.db

Added by René-Luc ReLuc over 7 years ago. Updated over 7 years ago.

Status:Closed
Priority:Normal
Assignee:Marco Hugentobler
Category:QGIS Server
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:16992

Description

qgis.db is used by QGIS Desktop or Server to store user defined Coordinate Reference System.

This storing is mandatory for drawing layers. QGIS-Server is looking for qgis.db in the directory /.qgis2/. If this directory exists and QGIS-Server has rights to create files in it, the qgis.db will be created but QGIS-Server does not CREATE TABLE. Because qgis.db has no TABLE, QGIS-Server cannot use QgsCoordinateReferenceSystem::saveAsUSerCRS.

To fix this issue we can had code in QgsCoordinateReferenceSystem::getRecordCount to create the table tbl_srs, or had in qgis_map_serv.cpp code to initialize qgis.db

History

#1 Updated by Marco Hugentobler over 7 years ago

Initializing qis.db in the server sounds reasonable to me. What about moving QgisApp::createDB() to core (e.g. static method in QgsApplication), then call it from QgisApp and qgis_map_serv during initialisation?

#2 Updated by Marco Hugentobler over 7 years ago

  • Assignee set to Marco Hugentobler

#3 Updated by Marco Hugentobler over 7 years ago

  • Status changed from Open to Closed

Initialisation of qgis.db from server is added in e00f0c006f8aca18d4d51f66c5245ee53e95bbb8.

Also available in: Atom PDF