In a standalone outside script for QGIS 2.18, i have a layer which contain multiple features to bufferize :   vlayer = QgsVectorLayer(out_dir + "selected_shape.shp", "blabla", "ogr")   I try to run processing for each features  from qgis.core import * from processing.core.Processing import Processing Processing.initialize() from processing.tools import * import processing  buff_res = processing.runalg("qgis:fixeddistancebuffer", vlayer, 0.2, 99, False, None,)  get_output= processing.getObject(buff_res['OUTPUT'])  for f in get_output.getFeatures():     print f.attributes()   The qgis:fixeddistancebuffer compute the buffer only on the first feature from my layer. How can i compute the buffer on each feature on this vlayer ?
9568
I'm looking for some examples to do simple python scripts in QGIS. How would I do a buffer analysis on a dataset? I can't seem to find much in the manual and QGIS python that quite matches the ESRI documentation.
93228
I am beginning to learn QGIS 3 up from QGIS 2.  I see many changes. In QGIS 2 one could find the scripts for the algorithms located in the Processing Toolbox but in QGIS 3 I cannot find them (for example, RandomExtract.py file). Can someone direct me to the path?
11874
I am a beginner using QGIS (1.8.0 Lisboa) on a Mac (OS X 10.6.8 Snow Leopard). I work on a file with two layers in the following sequence (top to bottom):    a vector polygon layer with a few outlines of various buildings in France and Italy (CRS: EPSG:4326 - WGS 84 - "on the fly" re projection is activated ) a Google satellite layer uploaded via open layer plugin.   Sometimes when changing the scale (scrolling in and out) the Google layer updates a little wrong in size or position compared to the polygon layer. But as soon as I "pan" the map everything reconstructs right. Now the problem I have concerns the print composer.  The result of any kind of export - pdf, or image or svg - of my map (vector layer + Google layer in the background) differs from what is shown in the preview of the print composer: the vector layer and the Google layer positions are mismatching and in a different scale. I can send some pictures showing screenshots of the print composer preview and the final results if required.  I tried almost everything:    new files with different CRS settings "cache" update preview "render" update preview different paper sizes,  different scales,   The problem appears only using an open layer map (Google, OpenStreetMap...). If I try the same using two vector layer (shapefile) - one with the buildings, another one with the city in background - everything works out great.  ...exasperating! Since it is a real important research project I would be very grateful for some help and tips.
86699
I use QGIS (2.10.1) to create buffers around polygons.  I often create a series of buffers, and later need to edit the underlying polygons.  It is frustrating to start from scratch in re-create several buffers based on the changes when this happens.  Is there a way to create a 'live' buffer, that will automatically update to changes made to the parent polygon, or as a second best, a means to replicate with one click, the buffer settings and formatting that you originally created?
92596
Does anyone know where the Processing menu moved in QGIS 2.4? Specifically, I am trying to install the LAStools box for QGIS following these instructions:
68204
I've been dealing with various problems after re-installing QGIS and other GIS-related software (see ).  The solution worked for a bout a day and now I lost the processing tool again. An other error message appeared when opening QGIS:  Impossible to load processing plugin provokes error when calling classFactory()  UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 18: ordinal not in range(128)   Traceback (most recent call last):   File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 306, in startPlugin     plugins[packageName] = package.classFactory(iface)   File "C:/Users/F�lix/.qgis2/python/plugins\processing\__init__.py", line 37, in classFactory     from processing.ProcessingPlugin import ProcessingPlugin   File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 572, in _import     mod = _builtin_import(name, globals, locals, fromlist, level)   File "C:/Users/F�lix/.qgis2/python/plugins\processing\ProcessingPlugin.py", line 47, in      if cmd_folder not in sys.path:   File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 58, in showWarning     "warning:%s\ntraceback:%s" % (warnings.formatwarning(message, category, filename, lineno), stk), UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 18: ordinal not in range(128)   Also, I have a second error when trying to re-install the processing extension through QGIS.  ImportError: cannot import name defaultOutputFolder   Traceback (most recent call last):   File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 281, in loadPlugin     __import__(packageName)   File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 572, in _import     mod = _builtin_import(name, globals, locals, fromlist, level)   File "C:/Users/F�lix/.qgis2/python/plugins\processing\__init__.py", line 28, in      from processing.tools.dataobjects import *   File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 572, in _import     mod = _builtin_import(name, globals, locals, fromlist, level)   File "C:/OSGEO4~1/apps/qgis/./python/plugins\processing\tools\dataobjects.py", line 35, in      from processing.core.ProcessingConfig import ProcessingConfig   File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 572, in _import     mod = _builtin_import(name, globals, locals, fromlist, level)   File "C:/Users/F�lix/.qgis2/python/plugins\processing\core\ProcessingConfig.py", line 32, in      from processing.tools.system import defaultOutputFolder ImportError: cannot import name defaultOutputFolder   Any ideas on how to solve this one?
12416
I'm very new to the GIS world, so my problem could be very stupid, but I'm going to try anyway.  Objective  Given a list of coordinates in longitude/latitude, stored as a .csv file, I want to create a buffer with distance of x km around those coordinates. (In case this is relevant, these coordinates are locations of the societies in the . These societies scatter all around the world.)  Problem  I'm only able to create buffers with distance in radial degrees, but I want to do them in (kilo)meters. I'm aware of the following Q&amp;A's, but following what's suggested therein doesn't seem to solve my problem:          What I have tried...   I start QGIS (v2.4), and Add delimited text layer  choose my .csv file and the x/y fields, click OK select WGS 84 as my CRS (also tried NAD83 but didn't make a difference), click OK right-click on layer and select Save As..., in the dialog box, choose the following and click OK:  add sccs_meter.shp as layer to the current project Select Vector > Geoprocessing Tools > Buffers > set buffer distance as 10   The result is a buffer with radius of approximately 1068km, which suggests that buffer distance is 10 degrees rather than 10 meters.  What did I do wrong here?
28459
I have a line layer and a polygon layer. Both files have the same SRS. I want in a new shape file only the lines covered by the polygons.   I tried in QGIS the Vector -&gt; Geoprocessing -&gt; Clip tool but I only get an empty shapefile.  How do I do this with QGIS?
37608
In QGIS I would like to clip a raster precipitation layer using an admin boundary layer that is vector data. However the Geoprocessing tools seem to be usable only for vector data. How can I clip this precipitation layer?
28891
I'm following the online qgis manual available on qgis website. I'm doing the step 21.11.3. ().   To make it simple : I have a raster converted to vector, so now it is a polygon (several polygons). I'm doing an interior buffer exactly how it is described in the manual. I didn't obtain the same result. I can see the interior buffer just in some polygons, not in all of them ->    The interior buffers appear just for those polygons, that don't contain a hole. I use qgis 2.18.3.  This is how i created the interior buffer ->    In green you see the input layer : suitable_terrain, in blue the output layer, the interior buffer.   It is not a problem of a projection. I use WGS84 UTM Zone 34S where the units are in meters. I did also the Check validity and i obtain the same result.
18253
First of all, I'm using Python 2.7.3, QGIS 1.8 (Lisboa) on Windows 7 pro 64 bits.  Now let's go to the actual question:  I have written some code (Python) that works well within the QGIS built in Python console, but now I need to run it from outside QGIS (it is too much to ask for the final user to open QGIS, then the python console and to copy and paste the code).  I have been trying to access the QGIS API, but it is missing from my PYTHONPATH. I've tried whatever is on the instructions, plus a bunch of paths like:  C:\Program Files(x86)\QGIS\apps\qgis\python\qgis and  C:\Program Files(x86)\QGIS\apps\qgis\python. My result so far is always the same:  import qgis.core ImportError: No module named qgis.core   Any ideas?
119020
I want to calculate some result using QgisRasterCalculator and using the code mentioned below.Problem is i am not getting any output raster also if i use this formula in raster calculator it gives nan.Please help.My code is  from qgis.analysis import QgsRasterCalculator, QgsRasterCalculatorEntry bohLayer = iface.activeLayer() entries = [] # Define band1 boh1 = QgsRasterCalculatorEntry() boh1.ref = 'boh@1' boh1.raster = bohLayer boh1.bandNumber = 1 entries.append( boh1 )  ## Define band2 #boh2 = QgsRasterCalculatorEntry() #boh2.ref = 'boh@2' #boh2.raster = bohLayer #boh2.bandNumber = 2 #entries.append( boh2 )  # Process calculation with input extent and resolution calc = QgsRasterCalculator( 'Float("%LE71970282002228EDC00_B6_clip.TIF (2)%" * 0.03705882) + 3.2', 'D:\UHI Plugin work\test\output\outputfile.tif', 'GTiff', bohLayer.extent(), bohLayer.width(), bohLayer.height(), entries ) calc.processCalculation()
44228
I am trying to run a standalone application. However, it does not run the program because of mentioned error in title. Here is my code:  from qgis.core import * from qgis.gui import * from qgis.utils import * from PyQt5.QtCore import * from PyQt5.QtGui import *  app = QgsApplication([], True) path = "C:/OSGeo4W64/apps/qgis-dev" app.setPrefixPath(path, True) app.initQgis()  canvas = QgsMapCanvas() title = "PyQGIS Standalone Application Example" canvas.setWindowTitle(title) canvas.setCanvasColor(Qt.white)  layer_info = 'LineString?crs=epsg:4326' layer = QgsVectorLayer(layer_info, 'MyLine', "memory") pr = layer.dataProvider() linstr = QgsFeature() wkt = "LINESTRING (1 1, 10 15, 40 35)" geom = QgsGeometry.fromWkt(wkt) linstr.setGeometry(geom) pr.addFeatures([linstr]) layer.updateExtents() QgsProject.instance().addMapLayer(layer)  canvas.setExtent(layer.extent()) canvas.setLayers([layer]) canvas.zoomToFullExtent() exitcode = app.exec_() QgsApplication.exitQgis() sys.exit(exitcode)   When I run it, I get this error:  Traceback (most recent call last):   File "C:/Users/DELL/Desktop/MyMap/myMap.py", line 1, in &lt;module&gt;     from qgis.core import *   File "C:\OSGeo4W64\apps\qgis-dev\python\qgis\__init__.py", line 72, in &lt;module&gt;     from qgis.core import QgsFeature, QgsGeometry   File "C:\OSGeo4W64\apps\qgis-dev\python\qgis\core\__init__.py", line 34, in &lt;module&gt;     from qgis._core import *   ImportError: DLL load failed: The specified module could not be found.  Python version is: 3.6 PyQt   version is: PyQt5.9 Windows 10 - 64bit  I also add many path:  %SystemRoot%\system32 %SystemRoot% %SystemRoot%\System32\Wbem %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\ C:\OSGeo4W64 C:\OSGeo4W64\apps C:\OSGeo4W64\apps\gdal-dev C:\OSGeo4W64\apps\gdal-dev\bin C:\OSGeo4W64\apps\gdal-dev\pymod3\Lib\site-packages C:\OSGeo4W64\apps\grass\grass-7.2.2\bin C:\OSGeo4W64\apps\Python36 C:\OSGeo4W64\apps\Python36\Scripts C:\OSGeo4W64\apps\Python36\DLLs C:\OSGeo4W64\apps\Python36\lib\site-packages C:\OSGeo4W64\apps\qgis-dev C:\OSGeo4W64\apps\qgis-dev\bin C:\OSGeo4W64\apps\qgis-dev\lib C:\OSGeo4W64\apps\qgis-dev\python C:\OSGeo4W64\apps\qgis-dev\python\qgis C:\OSGeo4W64\apps\Qt5 C:\OSGeo4W64\apps\Qt5\lib C:\OSGeo4W64\bin C:\OSGeo4W64\apps\qgis-dev\python C:\OSGeo4W64\apps\Python36\lib C:\OSGeo4W64\include C:\Users\Mustafa Uçar\AppData\Roaming\QGIS\QGIS3\profiles\default C:\Users\Mustafa Uçar\AppData\Roaming\QGIS\QGIS3\profiles\default\QGIS   How can I fix this error?
23589
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" and I want to create a shapefile named: T_1999_1_2.shp. The txt file structure is:     par;num;ano;mes;dia;D;btq   3;705;1999;1;2;-999,9;S;40,43885833;-8,43994167   3;619;1999;1;2;25,0;A;41,70972;-8,02699   3;718;1999;1;2;104,0;A;39,78055278;-8,82096667   3;766;1999;1;2;28,0;A;38,76620278;-9,12749444   3;560;1999;1;2;333,0;A;40,71492778;-7,89591667   3;669;1999;1;2;-999,9;S;39,83950000;-7,47866944   3;848;1999;1;2;-999,9;S;38,48486667;-7,47291667   3;555;1999;1;2;8,0;A;41,70655556;-8,80210833   I have tried to run the script but appears the same window error ("Error in file. File cannot be opened or delimiter parameters are not valid") My sript is the following one:  uri = "D:\PATRICIA\DOCUMENTOS\ESTACOES METEOROLOGICAS\DADOS METEOROLOGICOS\T\T_1999_1_2.txt?delimiter=%s&amp;xField=%s&amp;yField=%s" % (";", "x", "y")  vlayer = QgsVectorLayer(uri, "D:\PATRICIA\IG\QGIS\FWI\T\T_1999_1_2.shp", "delimitedtext")   I don't understand, why it doesn't work.
66153
I want to create a standalone python script using QGIS python API (PYQGIS) for education. First I create a model and export that model to python script.  original python script from the export :  ##=name ##raster=raster ##stat=output html outputs_QGISRASTERLAYERSTATISTICS_1=processing.runalg('qgis:rasterlayerstatistics', raster,stat)   Next I read this  and I tried to follow this tutorial to create my script.  Final script :  import sys from qgis.core import QgsApplication from PyQt4.QtGui import QApplication app = QApplication([]) QgsApplication.setPrefixPath("/usr", True) QgsApplication.initQgis()  # Prepare processing framework  sys.path.append('/home/username/.qgis2/python') from processing.core.Processing import Processing dem='aster.tif' slope='slope.tif' aspect='aspect.tif' outputs_SAGASLOPEASPECTCURVATURE_1=processing.runalg('saga:slopeaspectcurvature', dem,6,1,1,slope,aspect,None,None,None,None,None,None,None,None,None,None) Processing.initialize()  # Exit applications QgsApplication.exitQgis() QApplication.exit()   If I run this script it works fine without error but I don't take some export like aspect and slope (these can't be found?). Any idea why I can't take exports ?  I use Ubuntu and python 2.7 and QGIS 2.18.1.    i try to this script :  import sys from qgis.core import QgsApplication sys.path.append('/usr/share/qgis/python/plugins') import processing a=processing.alglist() print a processing.alghelp("saga:slopeaspectcurvature")   and i take that print any idea why ?  Algorithm not found   but if i use this module in QGIS work fine.
111536
I have CSV list with XY coordinates (company and its competitors) which I want to input into simple QGIS Processing model. From this list the model creates and styles two spatial layers.  Everything works well with one exception. I have the input CSV list set up to fixed directory path (see screenshot no. 1). I would like if the model allowed me to select the path to the CSV list when I run the model (see screenshot no. 2).  Does anyone know how to set up a CSV list as an input parameter to QGIS processing model?
41400
I am trying to create buffers around the Hurricane Sandy path I created in QGIS (points are lat/long).   I have both points from each day she was tracted and the line I created from it with Points2One.   When I go to make buffers around either the line or the points, the buffer takes up the whole screen. Its all just one color.   I have made buffers before but from data I did not create.   Right now all of my projections are set to WGS 84 EPSG 4326.