All Questions
22 questions from the last 30 days
2
votes
2
answers
154
views
Using PyQGIS to get data contained in the "in-memory editing buffer" of layer that is currently being edited
I am writing a Python plugin for QGIS and I need to be able to retrieve data about the current edits to a particular layer with in QGIS before the edits have been applied.
There does not seem to be ...
2
votes
1
answer
52
views
TypeError when exporting point cloud layer to drive with QgsPointCloudLayerExporter.doExport() via PyQGIS
I am trying to save some point cloud layers to disk without benefiting from the GUI export (that is to say using PyQGIS commands).
The point cloud layers are results of earlier filtering that I ...
0
votes
0
answers
79
views
Applying also the labels, assigning a .qml style file to a layer with PyQGIS
I'm working on QGIS 3.36 and I'd like to apply a .qml style file to a layer. Writing the following instructions of my code, the aspect of layer changes as I want it, but it doesn't load the labels ...
1
vote
1
answer
74
views
Run standalone PyQGIS script with processing algorithms from external plugins
Some of the external QGIS plugins contain processing algorithms integrated by the processing toolbox after installation, e.g. the plugin "Shape Tools".
How can the processing algorithms from ...
1
vote
1
answer
68
views
Add in content of text file in algorithm dialog in Processing tools text box
I am learning how to create my own processing toolbox, I just want to be able to select a text file and display the content in the multiline text box. I can put "some text" in it but not the ...
0
votes
1
answer
42
views
QGIS python configuration LayoutTable
I have a problem when I import layout template in QGIS project with Layout Attribute Table. In template I have two frames (tabela1 and tabela2) for one table which is connect to layer "VOZLISCA&...
1
vote
1
answer
56
views
Setting precision for decimal values when labeling layer with PyQGIS
I am currently working on a project in which I need to turn on the "RESULT_PRE" field label so this is the code but the field holds decimal values and I want to give a precision of 3 digits. ...
0
votes
0
answers
47
views
How to reduce load on calculations in PyQGIS
I am trying to calculate the length of a network with creating length field and giving it expression of '$length'. I have approximately 3000 features in layer. I tried two ways
By giving default ...
2
votes
1
answer
71
views
QGIS plugin showing multiple messages in the message bar
I am adding some user feedback to a plugin.
I have followed the pyqgis developer cookbook to create a message as below.
self.iface.messageBar().clearWidgets()
messagelinktext = 'something is happening'...
2
votes
1
answer
38
views
Getting Georeferencer target CRS with PyQGIS [closed]
According to the C++ code in qgsgeorefmainwindow.cpp I tried to retrieve the Georeferencer target CRS with PyQGIS using QgsSettings().value("/Plugin-GeoReferencer/targetsrs") but ...
1
vote
0
answers
48
views
"ImportError: attempted relative import with no known parent package" error when running QGIS Plugin in PyCharm
I am trying to run a Plugin that I created in the Python debugger and it gives this error:
ImportError: attempted relative import with no known parent package
Which appears to be related to this ...
0
votes
1
answer
38
views
Georeferenced images from a grid
I have a layer with the attributes height, width, x, y, vertex_ind and a path pointing to a non-georeferenced jpg image.
I know how to use the x,y coordinates of each vertex to translate the angles of ...
1
vote
0
answers
47
views
layer.materialize() function not copying all features within layer
What could cause the layer.materialize() function to not copy all the features within a layer?
Similar Post:
layer.materialize() does not copy all features
Steps to reproduce:
Drag an s57 file in ...
1
vote
0
answers
41
views
"Cannot import http://spatialreference.org/ref/epsg/3812/ due to ALLOW_NETWORK_ACCESS=NO" error in PyQGIS
I am building a headless PyQGIS application that will need to be integrated into a bigger system.
Everything works, but when reading a layer from a GML file, the output keeps printing:
Cannot import ...
2
votes
0
answers
45
views
"IndexError: list index out of range" error when reading memory layer with PyQGIS
In QGIS 3.22.10, I created a No Geometry layer and a group layer. The No Geometry layer was added to the group layer, and it was added perfectly. I can see the data in QGIS.
Here is the code for layer ...
1
vote
0
answers
30
views
Pasting code in python console in QGIS, recognize line change
I'm trying to simply paste Python code I have in a text file to the QGIS Python console.
While this worked before, I'm now receiving this error:
SyntaxError: multiple statements found while compiling ...
1
vote
0
answers
34
views
"No module named PyQt5.sip" error when using PyQGIS in standalone script
I tried to run Python code from PyQGIS Developer Cookbook | Using PyQGIS in standalone scripts
on Windows 10, but I got an error:
I installed PyQt5 and PyQt5-sip, and set all paths but the error ...
0
votes
1
answer
9
views
Is there a repository of WKT definitions for different non-Earth CRS?
QGIS seems to import unknown CRS definitions in WKT format. Given the data from so many non-earth systems out there, is there a repository of WKT format, where one can download them from?
1
vote
0
answers
22
views
QGIS Server missing DB Manager providers on Docker/Debian
i´m triying to create a QGIS Server container on Docker, following the example in documentation: docs. The purpose of this container is to export some layers from a .gdb file to an external PostGIS ...
0
votes
0
answers
19
views
Change geom value of a database layer
I have a view that matches my table. On it I have an Update trigger that normally allows me to update attributes such as geometry. But I can't update the geometry. I tried several thing but it didn't ...
0
votes
0
answers
25
views
Why does layer.materialize() fail to copy features in gpkg files containing json data?
After making this post: layer.materialize() function not copying all features within layer
I ran another multi-part test to determine why layer.materialize() does not copy all features within ...
0
votes
0
answers
18
views
Control rendering order in processing plugin doesn't work
I want to set rendering order for my layer Layer name by time field in descending order. When the layer is loaded in the project, I run the code below in the console and it works fine. But when I put ...