Python bindings for QGIS.

learn more… | top users | synonyms (1)

0
votes
2answers
53 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
12 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 ...
1
vote
0answers
19 views

Multiple QgsRubberBands; creation and destruction?

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
16 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
28 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
65 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 ...
0
votes
0answers
16 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 ...
1
vote
1answer
18 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
9 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
51 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
24 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
46 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): ...
1
vote
0answers
22 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
44 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). ...
1
vote
1answer
55 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
55 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
39 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
47 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
46 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
15 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
142 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
24 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
37 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
32 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
16 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
44 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 ...
0
votes
1answer
38 views

pyQGis scale based visibility problem

Im loading some layers from postgis using pyqgis in my standalone qgis app. For each layer i also load a style using: lyr.loadNamedStyle("style.qml") I've setup 2 versions of styles in qgis ...
2
votes
1answer
42 views

PyQGIS: subtracting two values and append ID to list

I would like to subtract two values retrieved from qgs feature iterator objects and append the value of the feature id to a list depending on a condition. I have two layers: roadsLayer pathsLayer ...
1
vote
1answer
37 views

How to remove a layer and its legend in a standalone pyqgis application?

In continuity in my question "How to add a legend to a canvas in a standalone PyQGIS application?" > In every addition of a new layer in my standalone application, the legend lengthens and becomes ...
1
vote
0answers
21 views

PyQGIS - Syntax for importing WKT file

I couldn't find any proper example of how to import a .csv with WKT coordinates (Polygon) in PyQGIS. Here are more details on my .csv. I am working with polygons. The delimiter is a semi colum, and ...
0
votes
1answer
30 views

Problem calling qgis2leaf outside the QGIS

I am a computer programmer starting with PyqGis-Python, and I’d need to automatize the creation of a webmap using the plugin of qgis2leaf from a QGIS Project. I have reached to call “import ...
0
votes
0answers
18 views

Multi Label with Multi Placement

is there any way to add multiple label at different placement in qgis. Suppose I have a vector layer for line geometry and my attribute are name and route number. Now i want to add the route number to ...
2
votes
2answers
121 views

How to use `layer.getFeatures()` in a standalone script?

I am following the QGIS Cookbook and this post where it concerns reading attributes from layers. I would like to exploit this method and implement it into a standalone script. Essentially, I want to ...
2
votes
1answer
45 views

use gdal python bindings from the QGIS folder in a custom script

I have QGIS installed (on Windows) and can import this line from the QGIS Python console: from osgeo import gdal When I try the import in a python file it doesn't work Traceback (most recent call ...
1
vote
0answers
68 views

Buffer Csv gets repeated when more than one feature is selected in mapcanvas in PYQGIS

I have a function which will allow the user to select a feature or more features in map canvas and performs buffer for the selected feature(s) and writes the output to a csv file. I dont have any ...
3
votes
2answers
126 views

How to add a legend to a canvas in a standalone PyQGIS application?

I am trying to develop a standalone PyQGIS application. The map display does not pose any problems, but I do not know how to add a legend to the canvas.
1
vote
1answer
54 views

How can I get features that satisfy a QgsExpression using PyQGIS?

I have two fields say "State" and "name" which would be get from the two comboboxes. After which, based on the current text in the combo box, I want to make QgsExpression and feature that satisfies ...
0
votes
1answer
47 views

How to access shapefile m-values with pyqgis?

Does anyone know how to access (read/write) m-values of a line-shapefile using pyqgis? I know how to do it with arcpy cursors ...
0
votes
0answers
35 views

Is PyQt4 'drag and drop' functionality available in Qgis Plugins?

In Qgis 2.8, is it possible to use the PyQt4 drag and drop classes (dragEnterEvent, dropEvent) to interact with items from a qtreeview, in a Python Plugin? Is it possible to hook into the ...
1
vote
1answer
37 views

How to implement Add feature action from PyQGIS

I'm trying to implement / reuse Add Feature functionality in my python plugin. there a class/function that handles geometry creation on canvas based on layer geometry definition? I'm checking API but ...
1
vote
2answers
62 views

How to install 3rd party python libraries for QGIS on Windows?

How can I use 3rd party libraries on QGIS plugins on Windows? I've developed a plugin that uses rasterio and numpy for a customer, but he's having problems installing rasterio and numpy. Actually ...
2
votes
1answer
100 views

Select by location in Python

I have a polygon layer and a point layer (with coordinates for each point). The polygon layer got created using the MMQGIS PlugIn (Hexagonal Polygons). I want to select all the points inside each ...
3
votes
2answers
92 views

Using folder wildcards to copy files with Python

I would like to copy the data of one specific shapefile from a specific folder ("Grid") to a number of folders containing the name "Country". The country shapefiles would keep their original name. ...
0
votes
2answers
56 views

Extract Elevation of Points from DEM using Python QGIS or GRASS

I am utterly new to GIS, so please bear with me if I am providing incomplete information here. I have a DEM file (.dt2). What I am looking to do is as follows: take a series of points specified as ...
2
votes
1answer
48 views

Not able to load any Raster File using QGIS Python

I am trying to run an elementary piece of Python code, that simply loads a dem file as a raster accessing the QGIS Python API. On the embedded console (within the QGIS application GUI), it runs fine ...
1
vote
1answer
32 views

Rename output shapefiles in PyQGIS

I have a shapefile which resides in a folder, gets processed and the output is saved in another folder. Before the output, I would like to rename the shapefile slightly differently from the original: ...
0
votes
1answer
49 views

polygonize giving duplicated polygons

I am trying to reproject some ascii files and convert them into shapefiles. I am new to python but looking at some code online and help files I was able to write the following code to run on Python ...
0
votes
1answer
42 views

Script not processing shapefiles from one folder to another

I am working on a script which takes shapefiles from one folder called "Original files", process them and then output the results into another folder named "Processed files. I asked a question on how ...
1
vote
1answer
67 views

differences in distance between shapely and geopy

I am getting totally different distances from shapely and geopy. On one hand - it makes total sense, shapely measures on a plane and geopy measures on a spheroid. But the differences are so dramatic, ...
1
vote
1answer
41 views

Rename layers with script

Just discovered Qgis and really impressed! I've not formal GIS training so rely on Google to figure stuff out. I'm using the SHP files made available by the Canadian Government as part of their ...