Class: QgsServerSettings¶
-
class
qgis.server.
QgsServerSettings
¶ Bases:
sip.wrapper
Constructor.
QgsServerSettings(
QgsServerSettings
)Provides a way to retrieve settings by prioritizing according to environment variables, ini file and default values.
Methods
Returns the server-wide base directory where HTML templates and static assets (e.g.
Returns the server-wide maximum allowed value for "limit" in a features request.
Returns the cache directory.
Returns the cache size.
Returns
True
if the bad layers are ignored andFalse
when the presence of a bad layers invalidates the whole project making it unavailable.Returns the ini file loaded by QSetting.
Load settings according to current environment variables.
Returns the log file.
Returns the log level.
Returns whether logging to stderr is activated.
Log a summary of settings currently loaded.
Returns the maximum number of cached layers.
Returns the maximum number of threads to use.
Overrides system locale
Returns parallel rendering setting.
Returns the QGS project file to use.
Show group (thousand) separator
Returns the server-wide max height of a WMS GetMap request.
Returns the server-wide max width of a WMS GetMap request.
-
apiResourcesDirectory
(self) → str¶ Returns the server-wide base directory where HTML templates and static assets (e.g. images, js and css files) are searched for.
The default path is calculated by joining QgsApplication.pkgDataPath() with “resources/server/api”, this path can be changed by setting the environment variable QGIS_SERVER_API_RESOURCES_DIRECTORY.
New in version 3.10.
- Return type
str
-
apiWfs3MaxLimit
(self) → int¶ Returns the server-wide maximum allowed value for "limit" in a features request.
The default value is 10000, this value can be changed by setting the environment variable QGIS_SERVER_API_WFS3_MAX_LIMIT.
New in version 3.10.
- Return type
int
-
cacheDirectory
(self) → str¶ Returns the cache directory.
- Return type
str
- Returns
the directory.
-
cacheSize
(self) → int¶ Returns the cache size.
- Return type
int
- Returns
the cache size.
-
ignoreBadLayers
(self) → bool¶ Returns
True
if the bad layers are ignored andFalse
when the presence of a bad layers invalidates the whole project making it unavailable.The default value is
True
, this value can be changed by setting the environment variable QGIS_SERVER_IGNORE_BAD_LAYERS.New in version 3.10.5.
- Return type
bool
-
iniFile
(self) → str¶ Returns the ini file loaded by QSetting.
- Return type
str
- Returns
the path of the ini file or an empty string if none is loaded.
-
load
(self)¶ Load settings according to current environment variables.
load(self, envVarName: str) -> bool Load setting for a specific environment variable name.
- Returns
True
if loading is successful,False
in case of an invalid name.
-
logFile
(self) → str¶ Returns the log file.
- Return type
str
- Returns
the path of the log file or an empty string if none is defined.
-
logLevel
(self) → Qgis.MessageLevel¶ Returns the log level.
- Return type
- Returns
the log level.
-
logStderr
(self) → bool¶ Returns whether logging to stderr is activated.
- Return type
bool
- Returns
True
if logging to stderr is activated,False
otherwise.
New in version 3.4.
-
logSummary
(self)¶ Log a summary of settings currently loaded.
-
maxCacheLayers
(self) → int¶ Returns the maximum number of cached layers.
- Return type
int
- Returns
the number of cached layers.
-
maxThreads
(self) → int¶ Returns the maximum number of threads to use.
- Return type
int
- Returns
the number of threads.
-
overrideSystemLocale
(self) → str¶ Overrides system locale
- Return type
str
- Returns
the optional override for system locale.
New in version 3.8.
-
parallelRendering
(self) → bool¶ Returns parallel rendering setting.
- Return type
bool
- Returns
True
if parallel rendering is activated,False
otherwise.
-
projectFile
(self) → str¶ Returns the QGS project file to use.
- Return type
str
- Returns
the path of the QGS project or an empty string if none is defined.
-
showGroupSeparator
(self) → bool¶ Show group (thousand) separator
- Return type
bool
- Returns
if group separator must be shown, default to
False
.
New in version 3.8.
-
wmsMaxHeight
(self) → int¶ Returns the server-wide max height of a WMS GetMap request. The lower one of this and the project configuration is used.
- Return type
int
- Returns
the max height of a WMS GetMap request.
New in version 3.6.2.
-
wmsMaxWidth
(self) → int¶ Returns the server-wide max width of a WMS GetMap request. The lower one of this and the project configuration is used.
- Return type
int
- Returns
the max width of a WMS GetMap request.
New in version 3.6.2.
-