Python bindings for QGIS.

learn more… | top users | synonyms (1)

0
votes
0answers
23 views

How to solve problem of non-ascii character on a zipfile on a plugin? [on hold]

I'm making a plugin that needs extract files from a zipfile before processes them. For this I'm using zipfile lib. The ZIP file contains filenames with non-ascii chars. If I run this code on a "QGIS ...
0
votes
0answers
29 views

How to ceate new vector layers / save output in QGIS scripting?

I need to create a script in QGIS which stores outputs. In this case, official documentation didn't help to me. When I use geoprocessing (processing.runalg()) for vector layers. In some cases, output ...
0
votes
1answer
21 views

How to update raster color ramp with new min/max values using PyQGIS?

I'm trying to update a single band psuedo color renderer with new min/max values from the python console. All the code samples i have been able to find deal with constructing a renderer from scratch, ...
0
votes
0answers
11 views

Add save/commit button to custom feature from

I would like to add a save/commit button to a custom QGIS feature from. This is very helpful when there is a linked table dispayed on the same form - the link will work only once the main table has ...
1
vote
0answers
16 views

How to run the QGIS viewshed plugin from the console?

I want to run the viewshed plugin from the console/ in a script in QGIS. Do you know if this is possible?
0
votes
0answers
29 views

Collecting data [on hold]

I'm using qgis, i'd like to know if there's an app that i can install on a tablet for collecting data, and after by connecting the tablet on my computer in order to upload the data ?
0
votes
0answers
9 views

AddFeatures returned values …?

i try to add Features in a polygon vector layer. i'm using for example the following lines : fet.setGeometry(ft_com.geometry()) bool=pro.addFeatures([fet]) bool returns me True (i see the added ...
0
votes
0answers
21 views

Automated Viewshed in QGIS

I want to create a workflow with a QGIS script where I need a viewshed tool. There is a really cool viewshed plugin. Unfortunately I am not able to access it in the QGIS console. I also found out that ...
0
votes
0answers
15 views

pyqgis, features geometry type changes to unknown after copying to anoter layer

Im copying a subset of features from a shapefile based QgsVectorLayer (polyline type shapefile) to a memory based QgsVectorLayer('LineString', layername ,'memory'): ...
1
vote
1answer
28 views

How to write a vector layer as tab delimited txt file using PyQGIS?

I'm using the following QGIS 2.8 Python code to save results to a txt file QgsVectorFileWriter.writeAsVectorFormat(inputLayer, "D:/dstest/my_csv", "CP1250", None, "CSV",True) I would like to be ...
0
votes
0answers
28 views

Identifying Left and Right Mouse Button Clicks in PyQgis application

I am relatively new to PyQt. I am trying create a custom plugin for Qgis which enables the user to select some features by drawing polygon on the canvas using mouse clicks and then performs ...
0
votes
0answers
42 views

How to create a Shapefile of a subset of input features in PyQGIS?

I'm having some trouble applying my Python skills to develop some scripts in PyQGIS. For me it's far simpler to write it in ArcPy, but then again I wouldn't get that much satisfaction after finishing ...
0
votes
0answers
7 views

Range problem in QDoublespinbox for different projections of data in QtDesigner\python

I have two QDoubleSpinboxes that updates the value of latitude and longitude of a point respectively. The data is in the CRS "EPSG:32643 - WGS 84 / UTM zone 43N" I had also set range of the ...
1
vote
1answer
29 views

QGIS Python Scripting permission denied

I've just started a Python Scripting tutorial on QGIS. The problem arrives right at the end, when I have to use this script: output_file = open('c:/Users/Ujaval/Desktop/airports.txt', 'w') for f in ...
1
vote
3answers
56 views

Is there any way to freeze the layer names in the TOC?

I would like to freeze the names of layers in TOC. Is there any way to do this via QGIS config or PyQGIS? I´m using QGIS Wien.
1
vote
1answer
30 views

fTool in pyqgis: Is it possible?

I am doing a work which I need to sample random points for many layers (classification of land use). Then, I'm trying to do a loop with my several layers and applied a functions of random pointos. I ...
1
vote
1answer
64 views

Logging layers openings?

i would like to log every layers openings in PyQGIS, regardless of the opened project. Is there a way to achieve that ? Where should be the Python code be located in that case ? Thanks for your help ! ...
0
votes
2answers
75 views

Create a script to add delimited text layer in QGIS

I'm trying to use QgsVectorLayer() function to add delimited text layer in QGIS. So I have a txt file (T_1999_1_2.txt) in path: "D:\PATRICIA\DOCUMENTOS\ESTACOES METEOROLOGICAS\DADOS METEOROLOGICOS\T" ...
0
votes
0answers
19 views

How to remove a QgsMapCanvasLayer from QgsMapCanvas with PyQGIS || C++?

I try to find a way to remove a QgsMapCanvasLayer from the QgsMapCanvas. At the moment I only can delete the MapLayer from the QgsMapLayerRegistry with: ...
1
vote
0answers
25 views

Adding Oracle Spatial Layer using Python Bindings of QGIS

I want to load a layer from my Oracle Spatial Database using the Python bindings of QGIS. I have tried loading the layer by creating the uri as shown in some previous posts. I am using the python ...
1
vote
2answers
32 views

How to add an image to canvas?

I am trying to make a QGIS plugin using Python. Right now I need way add an image to canvas but I don't want that image to be a new layer in qgis project. Is there a way to do it? Now I have: ...
2
votes
1answer
20 views

Unable to compile using make test in Linux

While trying to compile my test plugin I encounter this error, for the moment I can't figure out why, last week I had some issues on windows but eventually solved them via OSGeo Shell but this time ...
3
votes
2answers
90 views

How to create multiple QGIS layers from multiple text files?

I have a few hundred txt files (each representing a line of a river bed profile) that I need to load as (point-) layers in QGIS. Partial example: 4504764.8331;5374251.3024;397.8871;2 ...
3
votes
1answer
36 views

Getting co-ordinates of current map canvas using PyQGIS?

I'm trying get the extents of the current map canvas. CRS is 22700 BNG. My code: canvas = iface.mapCanvas() print canvas vLayer = iface.activeLayer() extents = vLayer.extent() print extents ...
0
votes
2answers
67 views

QGIS and Google Streetview?

Is there a way to open an (embedded or not in QGIS...) window containing a Google Streetview view at given coordinates using PyQGIS?
1
vote
0answers
22 views

Setting up PyCharm CE 4 to work with PyQGIS library in Mac OS

I am trying to set up pycharm to work with pyQgis library but with not success till now. I am using PyCharm CE v4 and QGIS version 2.8 I have tried to implemnte the instructions of several posts like ...
2
votes
1answer
96 views

How to create and remove multiple QgsRubberBands in PyQGIS?

Currently the following code-snip works great to highlight a shape based on the 'feature' and 'layer' variables: self.rubberHighlight = QgsRubberBand(self.iface.mapCanvas(),QGis.Polygon) ...
1
vote
0answers
29 views

How to add diagrams to a layer in a PyQGIS standalone application?

In my standalone application, I show different layers based on queries into a canvas. Now I want to add a layer with charts over by the values of an attribute. Is it possible in a standalone ...
2
votes
0answers
43 views

Is it possible to use memory layers in QGIS processing algorithms?

I am building a QGIS plugin that connects to a MySQL database in the local network, and then adds a subset of one of the tables to an in-memory layer; the subset is based on data currency (only taking ...
1
vote
1answer
98 views

Can we avoid using SIP library when writing standalone QGIS python script

I wanted to write a small custom python script using QGIS functionality. So I started with the QGIS documentation on the custom application section. After having some troubles with the import ...
1
vote
1answer
41 views

pyscripter : add a legend to my vector layer

I work on PyScripter, i managed to display a vector layer from Postgresql with a symbology. But I have a difficulty to display a legend. def main(): def init(): # appel de l'application et ...
2
votes
1answer
31 views

Multiple ComposerMap items not rendering properly Pyqgis

I am currently trying to put together compositions using inputs from two different map canvases. One is from a canvas built and controlled via a plugin, the other is the the main QGIS canvas (accessed ...
0
votes
0answers
30 views

Save Print/Map QGIS composer view as PNG/PDF using Python (without changing anything in visible layout)?

I have a QGIS composer/print view opened with all elements adjusted as I wish. Now I need to print/save/export this as a PNG or PDF file from Python console/Python script. I do not want to change ...
1
vote
1answer
79 views

PyQGIS - load PostGIS layer as editable

I can load a PostGIS layer on QGIS' map canvas but "Toggle Editing" button comes "inactive". How can I load vector layer as editable? The code given below loads PostGIS layer on map canvas & ...
1
vote
0answers
29 views

Create a checkbox per loaded layer in a QGIS plugin

I want to create check boxes inside a listview in my plugin dynamically based on the number of layers loaded in QGIS. I would like to know is there any similar existing plugin in QGIS so that I may ...
1
vote
1answer
56 views

How to get path for layers listed in a combobox?

I want to get the path of a layer in my plugin, in the console it works fine but in my plugin it gives me the error AttributeError: 'NoneType' object has no attribute 'dataProvider' def run(self): ...
2
votes
1answer
50 views

How to display a picture in QGIS custom form?

I'd like to integrate an UI file as a form in QGIS 2.8. The UI file is created in QT Designer. One of the attributes in the attribute table is a filepath to an image. I'd like to display the picture ...
1
vote
1answer
54 views

How to remove “ERROR 1” messages from a standalone QGIS script?

I am running a standalone script for QGIS which creates a high resolution grid and clips shapefiles onto it. Works perfect if the cell width and height have a high values (in my case, >200m for both). ...
2
votes
2answers
89 views

How to load a raster layer using PyQGIS?

I need to load a raster file from the provided file path. I wish to use it further in the Raster Calculator. I wrote a function which converts string (I assume it is a file path) to a raster object. ...
1
vote
1answer
70 views

PyQgis, styling vector layers in different canvas

I'm developing a QGIS plugin and I need some help with styling layers in different canvas objects. In my dialog window I've got two QgsMapCanvas objects canvas1 and canvas2. Layers from registry are ...
1
vote
0answers
42 views

Displaying symbology outside map canvas window extent?

Say we have equally distributed x,y mesh vector file. Each coordinate has a map-unit based diameter circle symbology. If we zoom into a region of the map canvas far enough, some centroids exist ...
2
votes
1answer
55 views

Tool Bar visibility in PyQGIS

I am creating a plugin for Qgis 2.6 and when my plugin loads up i want to disable the visibility of some of the tool bar. I was able to set the visibility for various tool bars like ...
1
vote
1answer
61 views

How to make a Standalone QGIS application run as an exe file

I had made a simple standalone application and that works fine. But the user have to execute a batch file(inside in which I had set the QGISHOME path, Python path and call my main python file) to run ...
1
vote
1answer
17 views

How to make the toolbar icon visible in the target machine without changing the path

I had done a simple standalone application that loads a shape file and does some basic actions like zoom in, zoom out, pan etc in the viewer. In my python file, I had set the icon path for all these ...
2
votes
1answer
145 views

Standalone script looping incorrectly?

Following on from my previous question, I would like the script to do the following (includes illustration): Search for the first shapefile (Paris (O).shp) in Country_France > Original files and ...
1
vote
0answers
35 views

PyQgis: Load qlr files

I have a plugin that loads a Raster image and selects the correct base maps to use. The Raster image load with no problem, but my base maps will not load. I have create a qlr, which has 5 references. ...
2
votes
1answer
46 views

Viewer not displaying the data in my standalone PyQGIS Application

I tried creating a standalone external application of QGIS using python and I followed the tutorial mentioned in the link ...
0
votes
0answers
36 views

pyqgis - refreshing only QgsMapCanvasItems not the entire QgsMapCanvas

I have a fairly complex map, consisting of many layers, and despite they're optimized, they still take a certain time to refresh. I also have a QgsMapCanvasItem representing my position, which i would ...
1
vote
0answers
22 views

Select features intersecting a linestring in QGIS

I wrote a python plugin that grabs all (vector, linestring) features between two points on the map. At the moment, I select all features intersecting the rectangle around these two points, and then ...
0
votes
1answer
57 views

Standalone External QGIS Application using python [closed]

I am creating a standalone external Application of QGIS using python and i am following the tutorial mentioned in the link ...