4
votes
Getting readable message level of Qgis.MessageLevel
As far as I am aware PyQt does not support iteration over names/values of Qt's enum types as you could do with standard python enums.
Instead, you can get information on the enumerator via the ...
3
votes
Accepted
ImportError when importing QgsRasterCalculator in QGIS
The QgsRasterCalculator class is part of the analysis module:
https://qgis.org/pyqgis/3.28/analysis/QgsRasterCalculator.html
2
votes
import module qgis.core in standalone script with pyqgis without running bat before with environment?
You can set the environment variable in your python script before you import qgis.core.
E.g. for the environment variable in your code above:
rem Append QGIS Python Plugins directory to PYTHONPATH
set ...
2
votes
Getting readable message level of Qgis.MessageLevel
They are a few functions having displayString in their name to convert an enum item to a "display string".
Like https://api.qgis.org/api/classQgsWkbTypes.html#...
2
votes
Use QGIS `processing.run(...., alg_params)` from OSGEO4W shell in QGIS Dev 3.26
To get this to work I had to do the following.
0 - Make sure there is nothing wrong with your install by first running C:\OSGeo4W\bin\python-qgis.bat and then try import qgis. If this gives errors the ...
1
vote
Getting readable message level of Qgis.MessageLevel
With pure Python, you can do introspection and create your own useful translator :
from qgis.core import Qgis
message_levels = {
getattr(Qgis, i): i for i in dir(Qgis)
if isinstance(getattr(...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
qgis.core × 5pyqgis × 4
qgis × 2
python × 1
raster-calculator × 1
pyqgis-3 × 1
standalone × 1
environment-variable × 1
bat × 1
logging × 1