Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 10123

Python bindings for QGIS 3.

4 votes
Accepted

QGIS Python get current atlas page name

Well, found it myself: @qgsfunction(args='auto', group='Custom') def getpage(feature,parent): projectInstance= QgsProject.instance() projectLayoutManager = projectInstance.layoutManager() …
MortenSickel's user avatar
  • 3,836
1 vote
Accepted

QGIS- python - output name of overlay

Looking a bit more around, I found that processing returns a directory with (at least) a key 'OUTPUT'. The value corresponding to this key is a unique layer id. So I can do output=processing.runAndL …
MortenSickel's user avatar
  • 3,836
5 votes

Reprojecting QgsPointXY

That is, for some reason, I ended up having to do point = QgsPointXY(float(lon), float(lat)) point = tr.transform(point) geom = QgsGeometry.fromPointXY(point) Trying to do geom.transform(tr) did …
MortenSickel's user avatar
  • 3,836
1 vote
Accepted

Reloading plugin makes new item in menu

Found it myself... I needed to specify the sub menu in the unload, so it becomes: DataLoader.py (unload): for action in self.actions: self.iface.removePluginVectorMenu( self.tr(u'&Spectr …
MortenSickel's user avatar
  • 3,836
3 votes

Renaming the result of QGIS Processing Algorithm

You can get the layer from the layer id: output=processing.runAndLoadResults("qgis:intersection",params) createdlayer=QgsProject.instance().mapLayer(output['OUTPUT']) createdlayer.setName('My shiny n …
MortenSickel's user avatar
  • 3,836
5 votes
Accepted

Dissolving using Python in QGIS 3

From om your first error message, it seems like layer_shp is a string, not a layer. You need to get hold of the layer - in different ways depending if it is a file name or a layer name. Your next pro …
MortenSickel's user avatar
  • 3,836
5 votes

Getting ordered list of IDs of selected features using PyQGIS

I do something similar in my StripChart plugin at https://github.com/sickel/qgisstripchart/blob/master/stripchart.py When I initiate, I define an array: self.selectlines = [] I set up a signal: self. …
MortenSickel's user avatar
  • 3,836