module object has no attribute classFactory
I asked this question several days ago on the QGIS developer list but didn’t get any love. I’m hoping someone can help me resolve this error. I have a custom repo and a custom plugin that I’m...
View ArticlePython script to automate saving satellite images for different combinations...
PS. : This is my first try at a GIS application. Please forgive if my question is pedantic. I would like to get a series of satellite images all at the same scale centered around different points on...
View ArticleTroubles Updating Values of Selected Features with PyQGIS
I’m trying to modify the values of some selected features. I have written this small script, but nothing happens when I run it. Is there something that I’ve missed? Here is my code. lyr =...
View ArticleLabel layout on python in QGIS
Now the only issue is that in image I am not getting the labels, I have on polygon. Please help in that too Please see above attached screenshots here I need labels – I have updated QGIS it’s version...
View ArticleUpdating feature attribute in QGIS plugin?
I am writing a plugin for QGIS (v2.12). There have been quite a few similar questions on this forum, but they don’t seem to work for me. my plugin does the following: get the vector layer check that it...
View ArticleDo I have to publish own QGIS plugins?
If I develop QGIS plugins for my company do I have to make them available to others? I use QT-Designer and think that it also depends on the question how you develop your plugins, right? For example:...
View ArticlePyGIS remove QgisVertexMarker from scene
I am writing a plugin that includes interaction with the map. Therefore I use a QgsMapTool. It is possible for a user to mark a point on the map. When the user clicks a red X is drawn on the mapCanvas...
View ArticleHow to set conditional imports for a PyQGis script running inner or outer of...
Related to Cannot run standalone QGIS script I try to detect if my script is run from a QGIS instance (through the plugin) or from a standard python console. This detection will enable conditional...
View ArticleWhy do I get different results from PyQGIS feature.geometry().type()?
On the python console in QGIS what is the difference between the following two code snippets (activeLayer is a polygon layer): # 1) iface.activeLayer().selectedFeatures()[0].geometry().type()...
View ArticleAdding PostGIS layer from QGIS Python plugin
I try to develop a plugin to add postgis layers to qgis from a plugin as part of learning python. The code for adding a postgis layer is taken from the cookbook and work fine if I run it from the...
View ArticleTry/Except Statement gives different Results in QGIS Console vs. QGIS Tool
I want my script to do different things depending on whether a particular layer DOES or DOES NOT exist in the Map Layers list. I thought the try: / except: statements would be the best way to achieve...
View ArticleApply symbol to each feature (Categorized symbol)
I want to apply unique symbol to each feature. i have used following code for doing that from qgis.core import * from PyQt4.QtGui import * # supply path to where is your qgis installed...
View ArticleHow to show only selected features from a a layer in the QgsComposerLegend?
I have developed a custom qgis plugin. I have a button to export the map canvas in the form of image along with the legend. I came up with the following code for the legend: legend =...
View ArticleReturn list of selected items of QListWidget PyQt QGIS
I’m a little bit confused (I’m a newbie) on how to get a list of just the selected Items of a QListWidget (in a QGIS plugin). I set up the manageGui function in this way: def manageGui(self):...
View ArticleShowing QgsAddAttrDialog in a Python plugin
I want to invoke the builtin add field dialog from my python plugin in QGIS: This is the add attribute dialog of the attribute table. It is located HERE. I expect it to return a QgsField. Unfortunately...
View ArticleHow to use third-party package in a QGIS plugin?
I’m developing a QGIS plugin and I would like to use arrow or requests packages as I’m used to manipulate dates and REST APIs. QGIS does not come with these packages (at less arrow), so when I try to...
View ArticleCan qgis_core work with external python distribution (such as Anaconda)
I’ve built a python application that has its own GUI. I am trying to use qgis.core/pyQgis as map display only. Specifically, i have anaconda 2.3 and its python distribution (2.7.11). After research on...
View ArticleDisplaying RGB raster on QGIS with no enhancement with Python Console?
I’m working with a RGB raster on QGIS 2.6.1, on a Windows 7 machine. I need to set the Contrast Enhancement option to No Enhancement with the Python Console (not through the Layer Properties window). I...
View ArticlePutting result of selection of plots in frame of QGIS?
I have made a plugin for QGIS in pyQt. Then I can make a SELECT from a PostGIS database and I get the plot or bunch or plots results of that SELECT in a layer. This layer is overlapped on the top of a...
View ArticleStore in a python list the attribute table of a vector in QGIS
I’m stuck with a very simple issue.. I’ve loaded in QGIS (through the py console) a csv layer (no geometry) made of 4 fields and 3 rows: #load the csv layer = QgsVectorLayer("path/to/the/csv",...
View Article