Skip to main content

Questions tagged [pyqgis]

Filter by
Sorted by
Tagged with
2 votes
1 answer
46 views

I’m trying to remove the “Bande 1” label that appears in the raster legend in QGIS 3.40 (Bratislava). This issue was already mentioned here: How to turn off QGIS legend band number by default? The ...
Fanny Chagnet's user avatar
0 votes
0 answers
32 views

Now project based custom functions are a thing (QGIS 3.44) I could streamline some of my management of QGIS expressions that get used in various places, so rather than finding all the instances of a ...
Sethinacan's user avatar
  • 2,360
1 vote
0 answers
79 views

I'm writing a QGIS plugin that uses a QMainWindow and includes several QActions. I'd like to trigger those actions via keyboard shortcuts, but only when the QMainWindow is active. The shortcuts I'm ...
Jesse Reilly's user avatar
0 votes
0 answers
35 views

I have a custom CRS that I want to use regardless of the profile I am currently working in. I can add the CRS to resources/srs.db and to resources/qgis.db (and to profile/qgis.db). A CRS added to ...
Dezmonder's user avatar
  • 309
1 vote
0 answers
38 views

I am writing a PyQGIS script to automate interpolation using the sagang:ordinarykriging algorithm (QGIS 3.28.13, SAGA 9.2.0). While the algorithm runs successfully with the default linear variogram ...
fmn_m's user avatar
  • 11
3 votes
1 answer
351 views

I have this little Python code. I want a button or at least a tool in the toolbox which I can click so the console does not have to be open all the time. I unterstand that saving this code as .py and ...
BAE_23's user avatar
  • 977
1 vote
0 answers
54 views

I'm using Python in conjunction with a custom form to autofill some fields. I add a vector layer to my project (via 'Add Layer' button) and then use: print(self.dlg.SelectedLayer.currentLayer()....
Doug's user avatar
  • 11
4 votes
1 answer
195 views

I have a script that exports multiple layouts using different layers. Part of it is changing the legend depending on which layer is being printed in the layout. I'm having trouble finding a way to ...
Blas Zlatar's user avatar
1 vote
1 answer
75 views

I update a list of WMS connections automatically with QgsSettings(). When the connection doesn't exist, it is well created with all good attributes. But when the connection already exists, and one ...
dmjf08's user avatar
  • 1,343
3 votes
1 answer
78 views

I am completing a project for my master's degree on sedimentary layers across South Wales deposited by a marine transgression event at the end Triassic. For the project, we're attempting to generate ...
mordecai_the_guy's user avatar
0 votes
0 answers
100 views

Let's use the following Python code (QGIS 3.36.2): from qgis.utils import iface class MyClass: def __init__(self,iface): self.iface = iface #self.test = "This is a test."...
Neph's user avatar
  • 341
0 votes
2 answers
101 views

I'm trying to build a customized QField form for a survey, but I'm having trouble with the customization. I need a button that, when clicked, opens a new empty UI where users can enter information for ...
userGIS's user avatar
0 votes
0 answers
59 views

I am programming a processing algorithm in PyQGIS that allows users to select certain natural protected areas from state-wide datasets that are stored in an internal data structure. The selection of ...
lzo_mrn97's user avatar
1 vote
1 answer
107 views

I have a permanent vector layer type linestring with only one feature. In the geometry a circle with a certain radius is saved. I will change the radius of the circle to a new value. This is my code (...
hitchhiker's user avatar
1 vote
0 answers
54 views

I am trying to export a GeoTIFF using a script in the QGIS Python Console, but the exported GeoTIFF is missing most layers. The image being exported is part of a larger canvas, too big to export as a ...
EagleOfToledo's user avatar
1 vote
1 answer
49 views

I am making a QGIS tool that will allow a two click point, first click is the geometry, second click gets the angle. I also need to open the default add feature attribute editor form. This is what I ...
Alex Gray's user avatar
  • 111
0 votes
1 answer
105 views

I wrote a processing script that creates a layer and adds it to the current project: class TestAlgorithm(QgsProcessingAlgorithm): def initAlgorithm(self, config=None): self.addParameter(...
Calidris's user avatar
  • 193
1 vote
1 answer
83 views

First, I'm trying to create a field for a vector layer. This is the one of the most basic actions. with edit(noViewLayer): noViewLayer.addAttribute(QgsField('DN',QMetaType.Type.Int)) QgsProject....
Tehem's user avatar
  • 41
2 votes
1 answer
149 views

I try to run a script that would add a layer definition file (.qlr) to a project in QGIS. The version of QGIS I'm using is very new (3.40.4-Bratislava). The Python code runs without error messages, ...
Mhoram's user avatar
  • 649
-2 votes
2 answers
123 views

In Spyder, I often use the GUI to restart the kernel to ensure that I have a clean slate. I am using QGIS to access Python (not for GIS) on a system where I have no other way to get Python. I googled ...
user2153235's user avatar
1 vote
1 answer
72 views

I have requested QGIS on a system for the sole purpose of using Python. There is no other means of getting Python on that system. While waiting for the installation, I installed and test drove ...
user2153235's user avatar
1 vote
1 answer
86 views

Within the QGIS python console, I've written a script that allows users to click a location and receive back information. This works well, so I'm now trying to convert it into a plugin. The basics ...
GbHeathcoteOS's user avatar
1 vote
0 answers
66 views

I have a polygon layer representing the outer areas of cities. The polygons do not create a closed "ring" most of the time and consist of multiple fragments. See my example drawing: How ...
MrSalamikuchen's user avatar
3 votes
0 answers
60 views

I’d like to write a QGIS Expression function in Python that takes a list of strings and joins them with a separator that can be given as an optional named argument sep which also has a default value. ...
Florian Jenn's user avatar
1 vote
1 answer
99 views

I want to generate multiple maps with one script. I define a dictionary map_configurations with names for each map and the wanted layers. I try to loop through the function create_map but my selected ...
BAE_23's user avatar
  • 977

1
2 3 4 5
158