4
votes
Accepted
Setting up thread with busy progress indicator or GIF in PyQGIS
As in my answer in the post you linked, I create a QgsTask MyTask with a layer parameter.
I just adapt the content of your method buffering in the run method of the QgsTask.
I defined 2 signals (...
4
votes
Placing plugin or action in submenu using PyQGIS or PyQT
It can be improved (tests, search of the submenu text) but the code below will add your action in the right Geoprocessing Tools submenu :
def add_plugin_to_geoprocessing_menu(action: QAction) -> ...
4
votes
Accepted
Sharing class variables across thread (QgsTasks) with pyQGIS
Here is working example. I have modified your code a bit. Because both your tasks have much the same function (to run a processing algorithm and return a result layer) I would prefer to only create ...
3
votes
Accepted
Conditional signals in QgsTask managing algorithm output
Try the example below. Sorry, your code was a bit of a mess, I basically tried to make it functional in the quickest way that I could. I suggest to now study the code and do your own research and self ...
3
votes
Georeferencer QGIS Import jp2 - Export jp2? - Is that possible?
Use the "Generate GDAL script" option of the georeferencer. It will generate two GDAL commands which look about this:
gdal_translate -of GTiff -gcp 494827 -7.0126e+06 3 6 -gcp 498813 -7....
2
votes
Accepted
Get M-value from shapefile by mouse click on canvas
There are two main issues with your code. First one is that QgsMapToolIdentify.identify() will return a list of identified features.
So you will need index your result variable before accessing any ...
2
votes
Accepted
QgsAttributeTableView shows nothing in my QGIS plugin
Your class lacks of self, so, at the end of the instantiation (= end of the __init__), the references of the objects without self not binded in other objects of the class are destroyed, so not ...
2
votes
Tiles XYZ plugin for newer versions of QGIS
So I figured it out. The plugin is now already within the QGIS processing tool box and it is known as Generate XYZ Tiles (MbTiles)
1
vote
PyQGIS: moving legend with changed reference point
From your screenshot, it is clear that your legend is being added to your layout, "except for being in the wrong place".
You haven't shown or explained how you calculated the layout point ...
1
vote
Using PyQGIS to buffer the width different than the height of a rectangle
Here a PyQGIS solution for 1 feature :
from functools import lru_cache
@lru_cache(maxsize=6)
def orientation_choices(num_coords: int, axis: str = "x") -> list:
if axis == "x&...
1
vote
Accepted
pyqgis 3 zoom to selected polygon without zooming in so far
I created a quick script with the setCenter method from the QgsMapCanvas class.
It allows you to change the extent of the canvas without changing zoom level. It works with Polygons, Lines and Points.
...
1
vote
Accepted
Pyqgis 3 adding polygon vector layer in code and triggering iface.actionAddFeature().trigger() will give me polygons but they cannot be selected
Regarding your first problem I can only assume that you forgot to commit your changes to the underlying data provider.
This could be an issue if you iterate through each feature and zoom to it's ...
1
vote
Accepted
triggering add feature action in polygon layer using pyqgis in my plugin, the polygons will not show up, although they are there
I was able to solve this by using this code after creating the polygon layer:
myalayer = root.findLayer(self.poly.id())
myClone = myalayer.clone()
parent = myalayer.parent()
...
1
vote
Adding a fixed table to layout in QGIS
Late to the party but an answer
composerTitle = 'Layout 1'
project = QgsProject.instance()
projectLayoutManager = project.layoutManager()
# Access to the layout by name
layout = projectLayoutManager....
1
vote
Creating Network Flow Diagram using QGIS
In my opinion, you should start with the telecom project you are working on. Next, for sure you will find the layers you need to include in your network flow schematic. You can follow the steps:
...
1
vote
Adding missing python packages to QGIS Plugin?
The place were the blessed route to a solution will be, if it can be found, is PIP dependencies for Python plugins QGIS enhancement proposal. It's a hard problem to solve. That thread contains ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
qgis-plugins × 2724qgis × 1745
pyqgis × 898
qgis-3 × 345
python × 312
qgis-2 × 193
qgis-processing × 170
pyqt × 88
pyqgis-3 × 86
raster × 66
installation × 56
grass × 51
error × 51
postgis × 45
python-2.7 × 45
pyqt5 × 40
c++ × 38
plugins × 36
coordinate-system × 32
openstreetmap × 32
qt-designer × 32
gdal × 30
print-composer × 29
polygon × 28
georeferencing × 28