Skip to content
Permalink
Browse files
Fix unreported QGIS_OPTIONS_PATH not really working for proj
Symptom: PROJ search path not including QGIS_OPTIONS_PATH because
initialization of QgsApplication happens before QgsServer loads
the settings.

TODO for the future:
remove QGIS_OPTIONS_PATH from settings and rely on QgsApplication's
env var QGIS_CUSTOM_CONFIG_PATH

Note that QGIS_CUSTOM_CONFIG_PATH gives /tmp/qt_temp-rUpsId/profiles/default/QGIS/QGIS3.ini
     while      QGIS_OPTIONS_PATH gives /tmp/qt_temp-rUpsId/QGIS/QGIS3.ini
  • Loading branch information
elpaso committed May 24, 2021
1 parent ffc500d commit 6f99e2649ab8a6a66206825805c554cb334272be
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/server/qgsserver.cpp
@@ -192,7 +192,10 @@ bool QgsServer::init()
QCoreApplication::setOrganizationDomain( QgsApplication::QGIS_ORGANIZATION_DOMAIN );
QCoreApplication::setApplicationName( QgsApplication::QGIS_APPLICATION_NAME );

QgsApplication::init();
// TODO: remove QGIS_OPTIONS_PATH from settings and rely on QgsApplication's env var QGIS_CUSTOM_CONFIG_PATH
// Note that QGIS_CUSTOM_CONFIG_PATH gives /tmp/qt_temp-rUpsId/profiles/default/QGIS/QGIS3.ini
// while QGIS_OPTIONS_PATH gives /tmp/qt_temp-rUpsId/QGIS/QGIS3.ini
QgsApplication::init( qgetenv( "QGIS_OPTIONS_PATH" ) );

#if defined(SERVER_SKIP_ECW)
QgsMessageLog::logMessage( "Skipping GDAL ECW drivers in server.", "Server", Qgis::Info );

0 comments on commit 6f99e26

Please sign in to comment.