Python bindings for QGIS.

learn more… | top users | synonyms

3
votes
1answer
1k views

How can I add button to the QGIS toolbox or create my own toolbox?

I want to create a button and add it to the QGIS toolbox or alternatively create my own toolbox and add the button here. A plugin should be started when the user clicks the button.
2
votes
1answer
216 views

Can't load PYQGIS

I get this error; any comments Couldn't load PyQGIS. Python support will be disabled. Traceback (most recent call last): File "", line 1, in ImportError: ...
3
votes
2answers
1k views

How can I specify the CRS of a raster layer in pyqgis?

I manipulating netcdf raster data from the QGIS python console. The metadata of my netcdf file does not provide the Reference system. However I know it is 'EPSG:4326' I am writing a python script to ...
3
votes
1answer
653 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 ...
3
votes
1answer
148 views

How to display a particular area?

Hy, I'm developing a plugin in python for Qgis. I would like the user to select a particular area in a list (let say a country list) and zoom in the map on the corresponding area. Actually I'm ...
3
votes
1answer
1k views

How to use gdal_contour in QGIS Python console?

Is there a way to use the gdal_contour utility with-in the python console of qgis ? Thank you
5
votes
1answer
1k views

Why can't I import my script from the python console?

i am working with the qgis python console. I usually store all my python scripts into ~/Scripts/python I do have set the PYTHONPATH to ~/Scripts/python in my .bashrc However, I can not manage to ...
2
votes
2answers
2k views

How to access attribute data type in QGIS?

I've been developing a plugin on QGIS platform using PyQGIS. So far plugin does the following: You can select any feature of the already loaded vector layer in QGIS. After selection, plugin displays ...
2
votes
1answer
301 views

How to connect QGIS to a WMS-C with python?

I would like to connect my QGis to a WMS-C server when my python plugin load. How can I do that ? BTW, the method: addRasterLayer do not seams to handle WMS-C layer...
4
votes
1answer
631 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
2
votes
1answer
460 views

How to display local file's geometries as rubber bands in QGIS

I'd like to get geometries from a local file (e.g. GML) displayed as rubber bands (QgsRubberBands) in QGIS. However, I wouldn't like to load the layer into the map because in the real scenario there ...
3
votes
1answer
822 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
570 views

How to translate ESRI cursor example to pyQgis?

For example, how to translate this code into pyqgis? rows = gp.UpdateCursor("D:/St_Johns/data.mdb/roads") row = rows.Next() while row: row.buffer_distance = row.road_type * 100 ...
3
votes
1answer
307 views

How to move Layer to back?

from my Plugin I've loaded a rasterlayer using the following code: fileName = "/path/to/raster/file.tif" fileInfo = QFileInfo(fileName) baseName = fileInfo.baseName() rlayer = ...
1
vote
1answer
289 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 ...
2
votes
0answers
144 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 ...
0
votes
2answers
204 views

extract edge of a line of a vector layer in a new point layer [closed]

I'm using python to build a plug-in in Qgis. I need to extract the edges of each line feature of a vector layer to create a new point layer of all edges. Someone can help me? My data input is a vector ...
3
votes
2answers
146 views

How can I read the settings for the QgsPaperItem from XML?

I saved a template qpt for the map composer and now I want to read all the settings. I am able to insert the items with composition.addItemsfromXML... But this doesn't load the settings for the ...
2
votes
1answer
328 views

How to add Real Attributes to Shapefile using pyqgis?

I created the Qmarxan plugin using the fTools plugin as an example base. When I create a new shapefile using the QgsVectorFileWriter function I don't have any difficulty specifying a "Real" field with ...
10
votes
1answer
934 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 ...