7
votes
Accepted
Where is the source code for the Processing Plugin "Buffer"?
The buffer algorithm is implemented in C++: https://github.com/qgis/QGIS/blob/fbc2082b7e25042c5f82cb000c52d84625b31624/src/analysis/processing/qgsalgorithmbuffer.cpp
The Buffer.py file you found is ...
6
votes
Accepted
Generating offset line from MultiLineString in QGIS
Try the "Translate" tool in the Processing Toolbox (Ctrl+Alt+T) (under Vector Geometry).
Set the x-axis to whatever distance you want to create the copy:
Output similar to the following:
5
votes
Problem to interface a script with python in QGIS
Add import processing to import section to get rid of NameError.
Since you use self.parameterAsSource, you get NoneType object .. error. Instead, use self.parameterAsRasterLayer.
Use the script below....
2
votes
Installing a custom Processing algorithm for all users
The quick and dirty solution would be to add your script to the existing QGIS processing provider:
Edit your script alg.py:
add the import: from processing.algs.qgis.QgisAlgorithm import ...
1
vote
Accepted
Run processing tools in Python console
In the params you have the output 'output', which is just a string. But you need to use the variable output
Then replace processing.run(algo, params) with the following:
processing.runAndLoadResults(...
1
vote
PyQGIS, custom processing algorithm: How to use selected features only?
The methods parameterAsLayer, parameterAsRasterLayer, and parameterAsVectorLayer of qgis.core.QgsProcessingAlgorithm evaluate complete map layers of the QGIS project (or usable files from outside of ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
qgis-processing × 1627qgis × 999
pyqgis × 626
qgis-3 × 304
qgis-plugins × 193
python × 115
qgis-modeler × 103
grass-gis × 101
saga × 79
pyqgis-3 × 72
qgis-2 × 70
raster × 52
gdal × 33
r × 30
vector × 27
standalone × 26
error × 25
raster-calculator × 24
batch × 24
polygon × 23
geometry × 22
postgis × 21
buffer × 21
algorithm × 21
field-calculator × 19