0
votes
0answers
21 views
SEXTANTE v.to.rast.attribute issue in script
I'm trying to convert a vector layer to a raster by using the GRASS function v.to.rast.attribute in Python.
My code doesn't throw any error but the raster image is only a square of 1px. But when I'm ...
1
vote
1answer
149 views
+50
How to add layer/raster with specific position in the QGIS layer list?
I use addRasterLayer(rast,'Name') but this adds the raster to the top.
It is possible to set position when I add raster at once? Is it possible??
2
votes
1answer
86 views
How to store attributes of a large shapefile in a list?
I am trying to store the attributes of a shapefile into a list. With following code it works for smaller shapes:
addA = []
While provider.nextFeature(feat):
attrs = feat.attributeMap()
for ...
-1
votes
0answers
44 views
add a column to table attribute in QGIS by writing a query
i try to add a column to my attribyte table by executing a query in postgresql, but i have several problems. I ask for ur help. This is the code i have tried :
from PyQt4.QtCore import *
import ...
1
vote
0answers
41 views
pyQGIS: How to write vector layer to csv file with geometry? [duplicate]
I use Python try to write vector layer file to csv file with this code
QgsVectorFileWriter.writeAsVectorFormat(mylayer, r'c:\temp\xyz.csv', "utf-8", None, "CSV")
it can export to xyz.csv but only ...
0
votes
0answers
16 views
connexion to postgres and update attribute table of a shapfile in QGIS [duplicate]
I have created a plugin with "plugin builder" , now I search to connect my plugin to postgres. I have a shapfile and I try to find a script in Python that can use to assign a SQL query to my table ...
0
votes
1answer
48 views
Make many lines in one layer (Python)
I what to create many lines with this code:
v_layer = QgsVectorLayer("LineString", "cable", "memory")
pr = v_layer.dataProvider()
seg = QgsFeature()
...
0
votes
2answers
70 views
Python to get ids from shp dont return all records
I have some Python code to get the ids and georeference from a shapefile:
canvas = qgis.utils.iface.mapCanvas()
allLayers = canvas.layers()
nos = QgsFeature()
for i in allLayers:
if ...
0
votes
1answer
76 views
How to convert geometry of SHP to decimals
I try to create a line with two points. These points are obtained in a SHP layer.
How can i convert that points to decimals?
Thank you
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 ...
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
61 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
74 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
70 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
52 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 ...