Linked Questions

9
votes
2answers
8k views

Activating layer by its name in PyQGIS

I'm writing a script that requires the attributes of different layers to work, and I would like to know how to call a layer that is not the currently active one and get its features. For example, I ...
7
votes
2answers
5k views

Getting layer by name using PyQGIS 3.0 [closed]

How do I get the layer by name using PyQGIS 3?
5
votes
1answer
763 views

Can I set the Project in QGIS to display data at Zoom Full on startup?

I have a project with several .qml files assigned to SHP files with the same name but different data. I am just changing the SHP files, but when I start the project with different SHP I see just the ...
4
votes
2answers
589 views

Copying and pasting features using PyQGIS

I have created a table join between two shapefiles which I've named 'OSMM' and 'Mastermap'. I want to copy and paste all features (polygons) without a match from the target layer ('Mastermap') into ...
6
votes
1answer
442 views

Adding Features with PyQGIS?

I'm new to PyQGIS and I'm having some dificulties. I'm trying to implement / utilize "Add Feature" (polyline) functionality in my python plugin. I know I can do this by defining starting and ending ...
2
votes
1answer
372 views

Syntax error using layer.getFeatures PyQGIS [closed]

I am simply trying to run a command in QGIS to extract the coordinates of a point layer, but I get a syntax error when trying to do so (see code below). I can not see where the issue is - any ...
2
votes
1answer
154 views

PyQGIS error when running zonal statistics?

I want to extract the sum of my raster cell values with a specific area through zonal statistics and have prepared the following code (see below). When I run the code I get the following error message ...
1
vote
2answers
100 views

Returning correct layer name in PyQGIS

I have seen this type of question posed a few times on this site. The solutions that I have gleamed from these questions has helped me. But I have not been able to get my script to produce a result ...
1
vote
1answer
171 views

Disconnect editingStarted in PyQGIS

I am creating a Plugin, where on addFeature button, first user will get a dialog box to select the type of feature user wants to draw. On the basis of users choice, other editing constraints will get ...
0
votes
0answers
43 views

Using PyQGIS to COPY Features from layer1 and PASTE to layer2

The Problem was sloved... See The following code: #========================================================================= # Copia los polígonos de un predio seleccionado desde la capa de "...