Tagged Questions
0
votes
0answers
24 views
How to write vector layer to csv file with geometry?
I 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 attribute ...
4
votes
1answer
60 views
How to set up Python 2.7 to work in both QGIS and ArcGIS?
I have both ArcGIS 10.1 and QGIS 1.8 installed and both include Python 2.7 in slightly different setups and in different folders (c:\Python27\ArcGIS10.1\ and c:\Program Files (x86)\Quantum GIS ...
0
votes
0answers
31 views
Fill up polygons with field value
I have now defined my renderer with a color map
I want to fill it with a value in the end field of my shape file's attribute table with python
how to do it??
I use QGIS 1.8.0 with python 2.7.3
0
votes
0answers
12 views
In QGIS Python can you nest QgsFeatureIterators on the same layer
I'm using the QGIS Weekly 1.9.0 in order to access the getFeatures(QgsFeatureRequest) method. The script is run in the Script Runner Plugin v0.71
Can anyone tell me what's wrong with this code? The ...
-1
votes
0answers
45 views
How to assign a SQL query to a table attribute? [closed]
I have created a plugin with "plugin builder." Now I seek to connect my plugin to postgres. I have a shapefile and I try to find a script in Python that can assign a SQL query to my table attribute. ...
1
vote
1answer
31 views
Combining polygon geometries with python and QGIS segfaults
I am trying to combine polygons, using Qgis 1.8, and every time I run this script in the python console, I get a segmentation fault. Here is the script:
from PyQt4.QtCore import *
iface = ...
0
votes
0answers
20 views
How to change value of an Line edit dynamically
I create a form in QT4 and compile with pyuic4. it create an form.py
I want to modify the value of the line edit dynamiclly with code.
I put this code in the form.py but never happen:
...
0
votes
1answer
38 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
67 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
73 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
1answer
29 views
QGIS Python - Convert geometry from Postgres to QgsPoint()
I have made a query in Postgres to get some points to use with python.
This points are in geometry data. How can I convert that geometry in decimals to use QgsPoint() in python?
Thank you
1
vote
1answer
70 views
Can I open a form in layer action?
I want to open a form (made in QTDesign) in the layer action. It is possible?
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
40 views
Is it possible to batch clip rasters in Quantum GIS?
I have been able to batch clip rasters in one directory using python in ArcGIS. However, I am not sure how to do the same in Quantum using the python console. Is this possible? If there are different ...
1
vote
1answer
99 views
spatialite.dll with Python and QGIS - the specified module could not be found
I'm having a bit of a nightmare getting to the bottom of this DLL loading problem. The stand alone script works absolutely fine but the exact same code does not work within QGIS.
import sys
from ...