
Setting up Visual Studio Code (Windows) for PyQGIS
Aug 7, 2018 · This do the same like file "C:\Program Files\QGIS 3.12\bin\python-qgis.bat". So if you run this file in CMD, and after that in the same CMD window, you write "set" and enter, …
Running simple Python script for QGIS from outside
To open QGIS, load a project, then, run a python script. qgis --nologo --project c:/path/to/projfile.qgs --code c:/path/to/code.py These commands should run on OSGeo4W …
pyqgis - Geographic Information Systems Stack Exchange
Mar 21, 2015 · You will need to tell your system where to search for QGIS libraries and appropriate Python modules if they are not in a well-known location — otherwise Python will …
Accessing QGIS processing with PyQGIS - Geographic Information …
I want to access the explode lines function in Python outside of QGIS from a standalone script. What module do I have to load in order to use it? How can I access processing? from …
qgis - Creating new empty vector layer with PyQGIS - Geographic ...
I have looked at a few tutorials on Python scripts for QGIS. All of them create new vector and raster layers with some existing data source e.g. shapefile or GeoTIFF or PostGIS database …
Iterating over map layers using PyQGIS
Mar 14, 2022 · For QGIS 2.6 here is the code to identify each layer and group them: #make the desired groups for layers toc = self.iface.legendInterface() root = …
Setting layer visibility with PyQGIS - Geographic Information …
qgis.utils.iface.legendInterface().setLayerVisible(m1, False) qgis.utils.iface.legendInterface().setLayerVisible(m12, True) I think mapCanvas doesn't have a …
Getting layer extent using PyQGIS - Geographic Information …
Jun 29, 2017 · This works like the "Extract layer extent" tool in QGIS 3.8 (may be a quicker way, but this works for me. There's some bonus stuff in here too, like adding and populating new …
qgis - Getting list of layer names using PyQGIS - Geographic ...
I need a list containing the names of all the layers in a QGIS session. I did the task as. layersNames = [] for i in self.iface.mapCanvas().layers(): layersNames.append(str(i.name())) …
Getting field names of layer using PyQGIS
Dec 5, 2022 · Note: using layer.pendingFields() doesn't seem to work in QGIS 3. See this thread for more details: AttributeError: 'QgsVectorLayer' object has no attribute 'pendingFields' This fails: