Tagged Questions
-3
votes
1answer
54 views
how to call a function when I press the button? [closed]
def function(self):
QMessageBox.information(self.iface.mainWindow(),
QCoreApplication.translate('HelloWorld', "HelloWorld"),
QCoreApplication.translate('HelloWorld', ...
0
votes
1answer
50 views
How to access the button on the form?
I have a form that appears when you start the plugin.How do I properly apply to the button on the form, so that when you click on the button performed "function".
import sys,os
import win32api
from ...
0
votes
1answer
25 views
Check if layer is a QGSVectorLayer from Python Plugin within QGIS
I am trying to extend some concepts in the QGIS Workshop tutorial. Basically, I would like to check if the layer is of type "QGSVectorLayer". In the QGIS Python console, I am able to type
canvas = ...
0
votes
1answer
33 views
How can I avoid UnicodeEncodeError when using geoprocessing tools in QGIS?
I have a shapefile, that I want to split with the "Split Layers by Field"-tool. Due to some umlauts (ä,ü,ö) there will be a python error as soon, as the tool reaches a feature with an umlaut. The ...
2
votes
1answer
61 views
How to access the road graph plugin in python?
I am developing a few scripts in Python for QGIS 1.8 to automate some geo-tasks and one of them would be to calculate the shortest distance from a hospital to each building in a town.
I would like to ...
5
votes
1answer
98 views
How to create a dropdown menu in QGIS Toolbar with Python
I Have a set of some QAction in my QGIS-Plugin and they are created and added to the toolbar like this
icon = QIcon(":/action1.png")
self.action1 = QAction(icon, u"Action 1", self.iface.mainWindow())
...
2
votes
1answer
53 views
How to see print commands through Python Script while programming plugin for QGIS?
This might sound like a silly question.
Is there a way that from running a custom plugin made for QGIS that a Python Shell can appear along when the plugin is run, like a debug screen. I'm asking ...
0
votes
1answer
42 views
How to reopen a plugin-window in QGIS?
I am currently taking my first steps in playing around with programming a plugin in python 2.7 for QGIS 1.8. While my plugin does what it should, I would like to make it more userfriendly. At the ...
0
votes
1answer
54 views
How to handle adding a PostGIS layer in pyQgis without saving password?
I'm writing python plugin and trying to find the right way to add PostGIS layer on the map without storing user password.
After adding layer on the map, I strip out the password from uri like this:
...
0
votes
1answer
55 views
What could I do to make QGIS find all the plugins?
I'm starting to use Ubuntu 12.10 and would like to get my QGIS running on it. Installation was fine but when I tried to add a package called Points to Paths the Plugin Manager was unabled to find it. ...
4
votes
4answers
110 views
How to display a “Save As” dialog for raster files?
I'm writing a QGIS plugin in python. I need to show a "Save as" dialog window in order to allow the user to select the path of the output raster file. Do I need to create a QFileDialog and manually ...
1
vote
1answer
81 views
Rpy2 Unable to Load in Fresh QGIS Install
after installing qgis the a message given below is shown
Unable to load the plugin: Unable to load required package rpy2.
Please ensure that both R, and the corresponding version of Rpy2 are ...
0
votes
1answer
125 views
How to properly add a Python Module to a Plugin?
I've been trying to use a module that is installed in my local version of python, but whenever I open the plugin itself, it does not manage to locate said module. The module in this case is Noise ...
1
vote
1answer
38 views
How to use QgsVertexMarker in a python plugin?
I am trying to display a vertex marker for a QGIS python plugin I am writing. I am getting a the following error...
'NameError: global name 'QgsVertexMarker' is not defined'
canv = ...
1
vote
1answer
97 views
Cannot install TimeManager 0.7: no module named six
I was able to extract and copy dateutil to C:\OSGeo4W\apps\qgis\python\dateutil and the error saying that dateutil wasn't found disappeared. But now I am getting the error no module named six. Tried ...
1
vote
0answers
76 views
How to handle mmqgis geocoding IOError: [Errno socket error] [Errno 101]?
I try to geocode a .csv file with QGIS + mmqgis plugin.
But, since some days the plugin always crashes.
I tried it with QGIS 1.8.0 on an Ubuntu 11.10, OSGeo-Live v6.0 (which is Xubuntu 12.04.2 LTS) ...
0
votes
2answers
239 views
Python module “shapely.wkb” missing
I am trying to follow a tutorial from here http://qgistips.spatialthoughts.com/2012/12/find-neighbor-polygons-in-layer-in-qgis.html#more
I have downloaded the relevant python script and edited it as ...
3
votes
0answers
46 views
Programatically reorder layers in qgis? [duplicate]
Possible Duplicate:
Sort layers in QGIS table of contents?
I write a qgis python plugin ,and i try to connect keybord keys to reoder layers in qgis .
Are there a method in qgis allows me to ...
4
votes
1answer
57 views
How to deliver an additional Python Library with own Plugin?
For my own plugin I need a special library (pyexiv2) to write a comment into a jpg file (PIL does not do that).
When I want to share my plugin in one of the repositories in the future, what would be a ...
1
vote
1answer
78 views
Why won't QGIS let me write to a file?
I am writing a QGIS Python Plugin. I am trying to write data to a file using
with open("filename.txt", "w") as f:
f.write("file text.")
QMessageBox.information(None, "Test", "Written to file.")
...
4
votes
1answer
249 views
How do I maintain a resposive GUI using QThread with PyQGIS
I have been developing some batch processing tools as python plugins for QGIS 1.8.
I have found that while my tools are running the GUI becomes non-responsive.
The general wisdom is that the work ...
5
votes
3answers
290 views
How to programatically check for a mouse click in QGIS
I want to know how to check for a mouse click in QGIS. I am trying to write a python plugin and want to provide functionality similar to the "Select Single Feature" tool that already exists in QGIS.
...
5
votes
1answer
145 views
How to transform a selected multipart feature into singlepart features while editing in QGIS?
There are several questions and respective answers for how to make a multipart features Layer into a singlepart features one using QGIS:
How to break a single polygon into multiple polys?
How to ...
1
vote
1answer
132 views
How to hide/show QGisVectorLayer from Python code?
Once created a layer, how can I hide/show it? I can enable/disable rendering of a specific layer by selecting the checkbox through QGIS, but I need to do it programmatically from python code.
How can ...
1
vote
0answers
123 views
How does QGIS execute Python plugins?
I am trying to run a python script from within a python plugin. The script runs a CGIHTTPServer in a separate thread. It works as expected when executed from the command line and i can issue requests ...
0
votes
0answers
61 views
How to apply an existing symbol in pyQGIS?
I'd like to change the layer rendering style from python code.
Basically I want to do the same operations I can do from QGis by:
Right-click on a layer
Select Properties
Select one of the displayed ...
2
votes
1answer
139 views
How to remove a vector QgsVectorLayer from QGis python plugin
I managed to add QgsVectorLayer in QGIS through a python plugin, for example:
vl = self.iface.addVectorLayer(uri.uri(), layerName, self.dbConn.getProviderName())
But how can I remove it?
1
vote
0answers
155 views
How to debug 'Layer is not valid error' from Python plugin?
I'm trying to understand what goes wrong with a QGIS python plugin.
Basically I'm trying to render a series of POINT.
The query works fine, at least giving it by hand from inside PostGIS DB:
"SELECT ...
5
votes
1answer
128 views
How to debug a QGis python plugin
I'm trying to write a python plugin for QGis. I'd like to debug some DB queries and I need a way to display the result.
I thought about using a popup to display it, but I don't know how to show a ...
11
votes
0answers
243 views
Python Plugin Development in QGIS: How to access label text?
I'm trying to create some custom labels for point features in a QGIS point vector layer, and I want to write a python plugin to do it. We need our labels to be presented with color tinted rectangles ...
6
votes
1answer
57 views
How to get info from selected object?
I am new to the Quantum Plugin development and wonder if there is more information about the following.
I have added a shape file and am (off course) able to select a point from this shape file. In ...
2
votes
0answers
50 views
Is there a way to distinguish between digitized and pasted features?
Is there a way to tell if an added feature in QGIS is in fact a newly digitized one or a pasted feature?
I think QGIS is treating both cases in the same way, emitting the same signal:
...
4
votes
1answer
62 views
Is it possible show the feature attributes dialog when I add a feature in code?
I want to know if it is possible to make the feature attributes dialog in Qgis show up when I add a feature by code using:
QgsVectorLayer::addFeature( tFeature )
This is available when I add ...
3
votes
1answer
57 views
How to use the QgsDiagramRendererV2?
I'm writing a plugin for QGIS in python
in the QGIS API doc, I can see the QgsDiagramRendererV2 class, under the qgs.core section
http://www.qgis.org/api/classQgsDiagramRendererV2.html
What I'm ...
3
votes
1answer
121 views
How to get raster layer pixels contained in a shape defined in a vector layer
I am new in QGis python plugins dev and I have a "maybe stupid" question (in the title :-) ).
I try to retrieve pixels (from a raster layer) which are "contained" in a polygon defined in a vector ...
1
vote
1answer
99 views
QGIS python plugin, segmentation fault, what can I do?
I'm trying to write a python plugin to create an input file for an urban climate model out of three shape files. Unfortunatelly QGIS closes when I try to load the plugin. When I start QGIS from the ...
4
votes
1answer
172 views
How to Create a raster layer from a numpy array using pyqgis?
I am working on a plugin for Qgis to calculate spatial Kernel density maps. I have all the calculations working, all I am missing is a way to turn a Numpy Array, with density values into a multiband ...
2
votes
0answers
193 views
How to access mysql data from python built-in console?
I'm writing a QGIS Plugin, and somewhere I want to present data from a MySQL database. It's simple data(strings,etc), not Geospatial, or vector data. I'm familiar with querying databases from python ...
1
vote
0answers
41 views
How to call a method when self.iface.actionSelectRectangle().trigger() is released?
In my QGIS python plugin I use "self.iface.actionSelectRectangle().trigger()" to select features. I also have a button which changes the attributes of the selected features.
Is there a way instead ...
2
votes
1answer
204 views
Are features of new labelling tool available to control via Python API?
I am writing a plugin using Python and currently using methods that set the label similar to those seen under Layer Properties. Some of the features under the new labelling engine available on the ...
9
votes
2answers
609 views
Is there a way to use “Select by Attribute” in QGIS using a python command?
is there a way to use the function "Select by Attribute" in QGIS using a python command? In my plugin the user should enter a value via a GUI and this value should be used in a function which selects ...
0
votes
0answers
29 views
How to apply a symbology stored in a qml file? [duplicate]
Possible Duplicate:
How to style a layer from console?
I'm writing a plugin for QGIS and I want to apply a symbology (rules) stored in a QML file.
And I don't know how to do that :-/
...
1
vote
1answer
143 views
installing module in embeded python in qgis
I'm newbie to Quantum GIS and Python.
I'm using QGIS in windows platform.
How I can install module for python embedded in QGIS?
Also, how can I run embedded python from windows directly?
Thanks
0
votes
0answers
182 views
Qgis python plugins development with Eclipse
I'm using Eclipse's PyDev extension to develop python plugins for Qgis.
I did the required configs for the interpreter in Eclipse to be able to use python.
When I start a PyDev project, all the Python ...
0
votes
2answers
336 views
An error has occured while executing Python code while doing home range analysis (Qgis 1.8.0)
It keeps appearing:
Traceback (most recent call last):
File "C:/Users/Worten/.qgis//python/plugins\HomeRange_plugin\HRplugin_dialog.py", line 80, in
QObject.connect(self.buttonBox, ...
1
vote
1answer
122 views
ReportLab integration into QGIS returns error message “no module named reportlab”
I want to use ReportLab in my own plugin which I have written for QGIS. I have installed ReportLab for the python versions 2.4, 2.5 and 2.6. The package is respectively installed into the ...
1
vote
1answer
570 views
How can I create a custom form to display the attributes of the selected object?
I have already appealed to the selected objects, and found a way how to put them in a MsgBox. But I need to output was in the form
3
votes
1answer
302 views
Changing attribute data types using PyQGIS
OK, so I've already asked a question how to access attribute data types when developing plugin for QGIS, using PyQGIS. And one helpful member said i should use pendingFields() method on the current ...
0
votes
0answers
58 views
How can I create form with controls using QGIS(python)? [duplicate]
Possible Duplicate:
How do I build a custom form for entering attributes in QGIS
Help me, please create a form with controls using QGIS plugin.
Thanks!
1
vote
2answers
151 views
Toggle editing option in plugins
I am working on python plugins for QGIS.I developed the plugins same as RT SQL LAYER plugins.
When we draw the layers using query builder of "Add Postgis Layer" option,toggle editing option is ...



