Tagged Questions
3
votes
1answer
72 views
How can I programatically create and add features to a memory layer in QGIS 1.9?
I had a working plugin in QGIS 1.8 which read data from an MSAccess database and added it to a series of memory layers. There is some processing involved in the interim so I don't think simply using ...
1
vote
1answer
58 views
open QGIS project with parameters
I am looking at a piece of work to deploy QGIS as the standard within an organisation. There is an existing piece of software that I need to link to QGIS so that when a button is pressed within the ...
2
votes
1answer
54 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 ...
2
votes
0answers
48 views
Python Script that calls the Voronoi Polygons Function?
I've been looking to see if there was a way to call Voronoi Polygons function found in Vector/Geometry Tools, directly from the code but I have not found one. Does this currently exist? Is there a way ...
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:
...
1
vote
1answer
60 views
How to get vector feature by mouse location?
I'm writing a photo grouping plugin. My current problem can be broken up into "end goal" and "baby steps", because I think that's what I want. But if there's a way to get to the end by a different ...
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
54 views
How do you Select an existing vector Layer and Edit it, using python?
I'm developing a small plugin that needs to be able to select a vector layer programatically based on what layer the user has selected. However I'm not sure how to do so.
I believe I found the two ...
2
votes
1answer
108 views
Handle add new feature event and/or access feature before commit?
Is it possible with PyQGIS to catch "add new feature" event before commiting changes on the layer? or at least to access new features before commit.
1
vote
1answer
65 views
Get feature while editing
I have created my custom form for features editing, using layer.setEditForm("form.ui") and layer.setEditFormInit("init") properties. init method receives dialog, layerId and featId as arguments. ...
1
vote
1answer
48 views
Raster menu does not have any tools in QGIS
in raster menu in QGIS, only raster calculator is available, how to get other tools, like wrap (reproject)
please see the image for help. help me to get this.
1
vote
1answer
167 views
Why do I get 'KeyError: 0' when using Line Intersection tool?
I'm using Quantum GIS version 1.8.0-Lisboa and trying to create intersection point using Intersection tool. (Vector -> Analysis tools -> Line Intersections )
But when I do that for my shapefile, It ...
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
1answer
146 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 ...
3
votes
1answer
65 views
Button to add a new line in a non-spatial table without opening the table itself using QGIS?
While using QGIS and having loaded a non spatial table (from PostGIS), is it possible to add a new row to its table attributes without having to open the attribute table first as in here Is it ...
4
votes
1answer
54 views
Can I add entries to the layerlist context menu?
I am implementing a python based plugin for use with QGIS 1.8.
Most of it's user interface is contained within a QDockWidget but there are some layer specific controls I would like to append to the ...
1
vote
2answers
517 views
How to fix QGIS PyQGIS package?
I have a broken package that is preventing QGIS from loading python plugins, updating itself, or even un-installing.
The main symptom of this problem is the following message that appears when QGIS ...
1
vote
0answers
156 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 ...
2
votes
1answer
611 views
TIN Interpolation using a vector layer
I'm writing a plugin in QGIS and I'd like to generate a TIN surface using a vector layer with x,y and z (interpolation attribute).
The idea is to visualize the same result like in the Interpolation ...
2
votes
1answer
102 views
How to move the QGIS Layerpanel/Dockwidget programmatically
i'm working on a QGIS-plugin and want to move the default LayerPanel/Dockwidget to somewhere else programmatically. More specific: i want to move it into a tab of my tabwidget.
Is this possible? How ...
1
vote
1answer
81 views
QgsVectorDataProvider.createAttributeIndex() fails in QGis 1.8
Adding an Attribute Index to a Shapefile fails for a Python Plugin in QGIS:
For example - the following python Code in a Plugin
ly = QgsVectorLayer(data_source, layer_name,"ogr")
prov = ...
1
vote
1answer
89 views
Is there a straight way to copy or clone a QgsVectorLayer Object?
Is there a straight way to clone or "deepcopy" a QgsVectorLayer Object with python? Unfortunately the python module "copy" is not successfull with that.
Thanks in advance!
nikolaus
2
votes
1answer
191 views
How to meet “Contour plugin” and “Profile Tool” dependencies in OSX?
So I have two similar but different issues than my previous question, one I may have mentioned already. When attempting to install the Contour plugin I am told I need matplotlib, which I have on my ...
1
vote
0answers
128 views
Qgis Plugin development with postgres data
can someone help me with initial developing on qgis plugin that displays postgres data table on a QTTableView or QTTableWidget?
So far:
I can connect to database using psycopg2 or using ...
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
1answer
382 views
QGIS: How to load feature (.qml) styles from python? [duplicate]
Possible Duplicate:
How to style a layer from console?
I'm trying to set the styles for a vector layer by loading the .qml file in the python console. The qml-style file contains all ...
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 :-/
...
2
votes
1answer
166 views
Is there an itemSelectionChanged Signal in Attribute Table?
The QgsVectorLayer class emits a selectionChanged() signal . If a QGIS user for example selects a record in the Attribute Table of a Vector Layer - a selectionChanged() signal is emitted an can be ...
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 ...
1
vote
0answers
225 views
How to change feature's geometry?
Hy,
I'm creating my layer like this:
crs = core.QgsCoordinateReferenceSystem(4326, core.QgsCoordinateReferenceSystem.EpsgCrsId)
uri = "Polygon"
uri += '?crs=' + crs.authid()
uri += ...
2
votes
1answer
247 views
How to load a postgres view using pyQgis?
Under Qgis 1.8 on Windows 7 I have this problem with my pyArchInit plugin: I need to load on the map canvas my geometries from a postgis layer. Till the 1.7.4 version I use the method explained on the ...
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 ...
4
votes
1answer
430 views
How can I add OpenLayers layer from the python console?
I am new to the python console.
How can I add a layer from the OpenLayers plugin from the python console?
Thank you
3
votes
1answer
392 views
Get a pixel value
How can i do this operation:
I want to get a pixel value fro the satellite image (Landat, GeoTIFF, 7 bands) using qgis-python.
What operators should i use? (for example in qgis's Python Console)
...
1
vote
1answer
164 views
How to handle geometry change in Vector Layer?
Hy,
I'm building a plugin in python that manage some lists of wkt from different intern sources (web services, bd, etc..).
I can display every source without any problem.
For displaying them, I use ...
1
vote
0answers
72 views
Setting border-style to 'no pen' using QgsGraduatedSymbolRendererV2
I am developing a QGIS plugin that, after a series of inputs, will produce a thematic map using the QgsGraduatedSymbolRendererV2. Because the polygon are very small, the boarders make it such that ...
6
votes
1answer
436 views
Is there a way to access QGIS plugins in Python?
Is there a way to access QGIS plugins in Python? I'd like to write a script to do some geoprocessing, and I'd like to use the clip, regular points and convex hull tools in fTools, as well as the Road ...