Python bindings for QuantumGIS (QGIS)
0
votes
0answers
17 views
QGis non blocking notifications with pyqgis [duplicate]
I'm searching for the way to use the new QGis non blocking notification system with the QGis python wrapper. I found informations on this fonctionnality but nothing on how to use this especially with ...
3
votes
1answer
71 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
41 views
Understanding the QGIS API documentation to write python code
I am not sure how to use the API documentation to code in Python.
For example, I want to determine whether a layer is a point, line or polygon layer and found the following in the API documentation:
...
1
vote
0answers
17 views
How to align QProgressBar label in QGIS messagebar? [migrated]
Unable to align the QProgressbar label in Qgis Messagebar. see the image below
While progressbar is updating,the label is vanished. so i tried the alignment for progressbar as shown below but its ...
0
votes
1answer
44 views
How to set Marker Line symbol for QgsVectorLayer by using Python?
QgsVectorLayer Right click->Properties->Style->Single symbol->click on simple line in tree node ->symbol layer type -> Marker line
Kindly help me to set marker line symbol programmatically by using ...
0
votes
2answers
67 views
How to make line with arrow head in QgsVectorLayer using python?
I need to draw line with arrow head or after drawn the line i need to make it as arrow head line by using python. or can we set any arrow head symbol for line features by using python?
Kindly help me ...
0
votes
0answers
54 views
How to use more than one QT form in Qgis Python? [closed]
I need a help to use multiple qt forms in PyQgis. For example, i need to open one qt form after the login form.
I tried like this:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core ...
0
votes
0answers
42 views
qgis python app how to add edit feature button?
I'd like to develop a QGIS Python app for plotting points and editing the attributes. I've started with the tutorials here: http://blog.qgis.org/?q=node/59 and read the cookbook ...
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 ...
3
votes
1answer
74 views
How to find the nearest line to a point in QGIS? [duplicate]
My question is that given a point and few lines, how should I go about finding the nearest line to the point?
I am aware of How to I find the nearest line to a point?, but that isin ArcGIS and ...
6
votes
1answer
133 views
How to draw perpendicular lines in QGIS?
I have a situation like this:
What I need to do is to connect each point to every line that is at most, let's say 200 m, away from the point. In other words, I need to draw a perpendicular line ...
1
vote
1answer
62 views
How to “Merge Selected Features” with python?
I have been looking for the answer to this question for some time now, but can't seem to find it! My problem is straight forward:
I have one layer
It contains lots of features (only polygons), say ...
1
vote
2answers
79 views
Creating QGIS layers in python console vs stand-alone application
I am having trouble creating a QGIS vector layer in a stand-alone python script while exactly the same code works fine in python console inside QGIS. The following code results in a proper ...
3
votes
2answers
191 views
How to automatically reloaded raster layer if source is changed in QGIS?
How to automatically reloaded raster layer if source is changed? (The path is the same but inside source file are changes)
I use:
qgis.utils.iface.mapCanvas().refresh()
but layer not refresh.
#
...
7
votes
1answer
119 views
Is it possible to show our custom message in QGIS Status bar using python?
Is there any way to show our custom message in Qgis Status bar using python? Just like in arcgis "IApplication.statusbar.message(0) = "Please wait..."
like that is there any option to show ...
1
vote
1answer
45 views
How to get a message when the map is moved in QGIS?
I want to get a message when every time I move the map.
I had:
def info(self):
QMessageBox.information( self, self.tr( "Info" ), self.tr("info") )
I suppose that used to be something like ...
1
vote
1answer
52 views
Joining table to shapefile with pyQGIS
Joining shapefiles is a relatively straightforward proess in QGIS using 'add vector join' in the layer properties menu. I can add a csv file as a vector layer, as well as a shapefile, and join the two ...
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 ...
4
votes
1answer
92 views
Speed of editing attributes in QGIS from a Python plugin
I'm trying to edit the value of an attribute for each feature in a layer using a QGIS Python plugin. I've found that doing this outside of editing mode is much slower than while editing (even ...
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 ...
1
vote
1answer
42 views
How to get CRS of a raster layer in pyqgis?
I have this problem accessing to the coordinate reference system(crs) of a raster layer map.
I wonder if such thing is possible?
I have used this xml from GDAL open map service to load in a raster ...
2
votes
2answers
69 views
How to determine the coordinates of the corners of the raster layer
How can we determine the coordinates of the corners of the raster layer? The image opens function QgsRasterLayer.
6
votes
1answer
96 views
How to save python session in QGIS?
After running a lot of scripts in QGIS' python console, I have more than 10 dictionaries and lists, and I need these for further analysis. Is there a way to save python session, with all these ...
1
vote
1answer
55 views
How to add MS SQL table using python console?
I have MS SQL Server 2008 R2 database. How to add MS SQL Table using python console in QGIS?
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:
...
6
votes
1answer
116 views
How to address the new “Task-Completed” QgsMessageBar in Python?
I am really amazed what huge steps the QGIS development has taken in the last months. The new iconset, the improved Print composer and many more changes to be seen in QGIS 2.0 are really awesome!
...
2
votes
1answer
74 views
How to add one or more points to an existing polyline or polygon?
Using the following code, I make a polyline with two points.
vl = QgsVectorLayer("LineString", layerName, "memory")
pr = vl.dataProvider()
vl.startEditing()
fet = QgsFeature()
...
2
votes
1answer
38 views
How to check if two qgsPoints are equal in PyQgis
I have two points:
a=QgsGeometry.fromPoint(QgsPoint(227739,908343))
b=QgsGeometry.fromPoint(QgsPoint(227739,908343))
but when I run:
a==b
it returns False.
What am I doing wrong?
Update:
it ...
0
votes
1answer
50 views
How to save after using fet.setFeatureId in pyQGIS?
By using the following code, I want to change the id of the line when saving the line. But the setFeatureId command, gives a false when doing the commitChanges(). Any idea how to change the id?
vl = ...
3
votes
2answers
90 views
How to write an equivalent to MapBasic's CreateLine in pyQGIS?
I know this kind of question has been asked, in part, before - specifically: Seeing QGIS Python Commands and: How is object created as line using createline stored in .tab file?
but this is a specific ...
1
vote
1answer
75 views
How to store selected attributes of vector layer using PyQGIS
I'm following this PyQgis workshop:
http://www.qgisworkshop.org/html/workshop/python_in_qgis_tutorial2.html#accessing-data-attributes
I have a point layer shapefile. I want to be able to retrieve and ...
3
votes
1answer
61 views
How to calculate all paired shortest path using PyQGIS?
The code for shortest path analysis with PyQGIS specifies start and end nodes explicitly:
pStart = QgsPoint( -1.37144, 0.543836 )
pStop = QgsPoint( -1.1027, 0.699986 )
...
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 ...
1
vote
2answers
80 views
How to change vector attributes values?
I want to change vector attributes values.
i could not get the command fet.setAttribute
indeed, it is mentionned in http://hub.qgis.org/issues/7223 that:
"The QgsFeature instance now must be ...
1
vote
2answers
142 views
PyQgis overwrite shape file and adding layer to Qgis
I am creating a shapefile in python by:
driver = ogr.GetDriverByName('ESRI Shapefile')
datasource = driver.CreateDataSource('c:/temp/toke2.shp')
layer = ...
1
vote
1answer
102 views
How to write a CSV from Python console in QGIS?
I am trying to write out a CSV file from a vector layer made up of points using the python console in QGIS. I've tried the following command:
QgsVectorFileWriter.writeAsVectorFormat(layer_Map, Folder ...
0
votes
1answer
72 views
Split Map using Python in Qgis
I have a map, in which each region is defined as an attribute of the map (I can select each region from the attribute table). I am trying to create new layers each one containing only 1 region using ...
1
vote
1answer
87 views
How to evaluate raster calculator expressions from the console?
How can I execute from the console an expression that should be used with the raster calculator?
I'm searching for something like this:
qgis.someRasterCalcClass.evaluate("boh@1 + boh@2", ...
1
vote
1answer
53 views
How to use QgsOverlayAnalyzer class in pyQGIS?
I am very new to Python scripting in QuantumGIS, so bear with me please.
I am trying to use the QgsOverlayAnalyzer class in QuantumGIS (http://www.qgis.org/api/classQgsOverlayAnalyzer.html#details) ...
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 ...
3
votes
1answer
164 views
How to deploy a QGIS Python Standalone Application with minimum installation size?
I am trying to create a Standalone QGis Application using python. I was able to create the nice looking shapeviewer application by following the steps here.
Now I would like to deploy this in ...
0
votes
0answers
42 views
How to begin with tool development for GRASS gis or QGIS GRASS
I wanted to begin with customized tool development in Grass GIS or QGIS grass. How should i begin in to develop the tool. I search a lot in google search engine for begin with tool development in ...
0
votes
1answer
88 views
How to read the attribute values using pyQgis?
What is the way to get the information contained in the attribute table, say in column 2, row 2 using pyQgis?
1
vote
2answers
87 views
Where exactly are qgis.gui and qgis.core located?
I'm trying to create a standalone qgis app using pyqgis, i'll be deploying it by copying the install folder of qgis and source folder of my app, and so for the testing purposes i copied qgis install ...
4
votes
1answer
126 views
Personal shell launcher for PyQGIS
I have changed a shell launcher found at http://inasafe.linfiniti.com/html/id/developer-docs/platform_windows.html as to fit my wish: setting the system environment variables to be able to use PyQGIS ...
1
vote
0answers
51 views
How to delete a point with known coordinates in python?
I was wondering if there is a piece of code that does the opposite that setGeometry does and removes a point if there is one at x and y coordinates?
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
89 views
QGIS Zoom from python console
What are the commands to apply all types of zoom (full, on selected layer, etc.) in python console?
I'm searching both on pyqgis cookbook and API documentantion, but I'm not finding anything ...
2
votes
2answers
155 views
Extract coordinates from vector layer in PyQgis
In Qgis, I have made a polygon, and from that polygon I have made a vector grid via research tools-> vector grid. The grid covers the entire polygon.
Now I want to extract these grid points in the ...
3
votes
1answer
62 views
How to auto-start a pyQGIS thread?
having build some (two) minor plugins, it's now time for me to link a few (perl-) applications to qgis. As there is no perl-interface in qgis I thought the best way to link both worlds together is a ...



