1847 Commits

Author SHA1 Message Date
Mathieu Pellerin
b5dc9fd3cd [processing] restore and improve lines to pol / pol to lines algs (#4850)
New geometry model for lines to pol / pol to lines agls.
2017-07-14 14:44:38 +07:00
Nyall Dawson
f84a3bbd04 Merge pull request #4819 from nyalldawson/layout_gui
Layout GUI work (pt 1/?)
2017-07-14 10:22:38 +10:00
Nyall Dawson
0639264a4a Merge pull request #4852 from nyalldawson/heatmap_source
Use QgsFeatureSource instead of QgsVectorLayer for QgsKde
2017-07-14 10:19:15 +10:00
Harrissou Sant-anna
99ea2e8e8f Use Cartesian instead of cartesian 2017-07-13 17:40:55 +02:00
Nyall Dawson
4fa69643fc Fix heatmap widget wrapper, update to use source input 2017-07-13 20:52:16 +10:00
Nyall Dawson
8f19f74893 Fix reportError call 2017-07-13 20:11:37 +10:00
Nyall Dawson
653ef7b243 Update heatmap alg to use feature source instead of layer 2017-07-13 20:11:28 +10:00
Alexander Bruy
8285712d68 more test fixes 2017-07-13 12:11:42 +03:00
Alexander Bruy
229d2f1add [processing] port heatmap algorithm 2017-07-13 12:11:42 +03:00
Alexander Bruy
97a5a3dcbd [processing] use QgsProcessingException in algorithms 2017-07-13 09:02:10 +03:00
Mathieu Pellerin
d3ad9131f4 [processing] restore intersection algorithm (#4849) 2017-07-13 11:07:01 +07:00
Mathieu Pellerin
b46373b084 [processing] restore union algorithm 2017-07-12 20:54:51 +07:00
Nyall Dawson
a87cc53e96 Nicer debugging from boundary alg 2017-07-12 18:55:27 +10:00
Nyall Dawson
91d6ac9537 Update script algorithms for auto output creation 2017-07-12 07:50:13 +10:00
Nyall Dawson
7bb1b7ade0 Cleanup some imports, remove use of dataobjects 2017-07-12 07:44:39 +10:00
Nyall Dawson
d92583c10e Take advantage of auto created outputs in ported algorithms 2017-07-12 07:39:43 +10:00
Mathieu Pellerin
18b52b22f1 [processing] restore difference algorithm 2017-07-11 17:00:44 +07:00
Nyall Dawson
4c2447fd89 Add shell for QgsLayoutView 2017-07-11 11:06:35 +10:00
Nyall Dawson
1e13d733c2 Move declaration of algorithm parameters/outputs to a new virtual
initAlgorithm() method

This allows 2 benefits:
- algorithms can be subclassed and have subclasses add additional
parameters/outputs to the algorithm. With the previous approach
of declaring parameters/outputs in the constructor, it's not
possible to call virtual methods to add additional parameters/
outputs (since you can't call virtual methods from a constructor).

- initAlgorithm takes a variant map argument, allowing the algorithm
to dynamically adjust its declared parameters and outputs according
to this configuration map. This potentially allows model algorithms which
can be configured to have variable numbers of parameters and
outputs at run time. E.g. a "router" algorithm which directs
features to one of any number of output sinks depending on some
user configured criteria.
2017-07-10 16:31:14 +10:00
Nyall Dawson
03275bbace Split QgsProcessingAlgorithm::create into non virtual-create
and pure virtual createInstance

Allows us to add logic which always need applying within
create(), leaving createInstance() free to just return a
raw new instance of the class
2017-07-10 10:07:32 +10:00
Nyall Dawson
9d04f87249 Rename "output" style parameters for clarity
The previous naming was too easily confused with processing outputs.
Rename them to QgsProcessingParameterFileDestination, etc... to
make it clearer what they are used for.
2017-07-08 20:49:17 +10:00
Nyall Dawson
f82b41e001 Move an enum to new QgsProcessing class 2017-07-08 20:49:17 +10:00
Nyall Dawson
febf0a0e6e Rename method to more generic name - it's usable by vector layer outputs too 2017-07-08 20:49:17 +10:00
Matthias Kuhn
875a5d6d9d Merge pull request #4818 from DelazJ/spelling
Fix some spelling issues
2017-07-08 10:20:40 +02:00
Nyall Dawson
55ce31b371 When calling procesing.run(), map layer results are automatically
converted to QgsMapLayer objects with the ownership transferred
to the Python caller

This should make it super-easy for PyQGIS scripts to run processing
algorithms and immediately utilise the results, even if they
are memory layers. They call processing.run(), and get a dict of
results back which includes those layers ready for adding to the
current project or doing some other processing or operations
with, and if they don't transfer to ownership off then these
layers will be correctly garbaged collected by Python.
2017-07-07 09:28:20 +10:00
Nyall Dawson
a2af3a9345 Make concave hull alg more efficient
- remove temporary layers from context, delete them as soon as they
are finished with
- directly remove features via data provider, instead of selecting
and using edit buffer
- use native geometry methods for splitting to single features
and removing rings
2017-07-07 09:28:20 +10:00
Nyall Dawson
db816ec3fe Port a multi-step algorithm to new API (concave hull) 2017-07-07 09:28:20 +10:00
Nyall Dawson
a15d283cd6 Port delaunay triangulation alg to new API 2017-07-07 09:28:19 +10:00
Nyall Dawson
75cd91b1a0 Port voronoi polygons algorithm to new API 2017-07-07 09:28:19 +10:00
Nyall Dawson
90f10ae853 Port snap geometries algorithm to new API 2017-07-07 09:28:19 +10:00
Nyall Dawson
8a84e134cc Algorithms don't have to be split to prepare/process/postProcess
Since it's safe to evaluate parameters in background threads
now, it's usually going to be ok to evaluate everything in
the processAlgorithm step.

This keeps the algorithm code as simple as possible, and will
make porting faster.

Note that the prepare/postProcess virtual methods still exist
and can be used when an algorithm MUST do setup/cleanup work
in the main thread.
2017-07-07 09:28:19 +10:00
Nyall Dawson
3108d68f87 Indentation 2017-07-07 09:28:19 +10:00
Nyall Dawson
4fa2bc025c Keep correct order for zonal stats options, set some stats by default 2017-07-07 09:28:19 +10:00
Nyall Dawson
4eca20f28d Fix zonal stats algorithm execution 2017-07-07 09:28:19 +10:00
Nyall Dawson
8cfcf57541 Fix tests 2017-07-07 09:27:35 +10:00
Nyall Dawson
e0c7daa2d8 Rename QgsProcessingAlgorithm::clone to ::create
Since it better describes what the function does. It returns a new
pristine copy of the algorithm, not a clone of its current state
2017-07-07 09:27:35 +10:00
Nyall Dawson
cd7776ca1c Upgrade ported python algs to be thread ready 2017-07-07 09:27:35 +10:00
Harrissou Sant-anna
6fab688298 Use SpatiaLite right spelling when needed 2017-07-07 01:26:38 +02:00
Nyall Dawson
1b2afea23e Add some more clone methods to algorithm subclasses 2017-07-07 09:26:17 +10:00
Harrissou Sant-anna
450eb7c24a Spelling check: Replace analyse by analyze 2017-07-02 22:28:50 +02:00
nirvn
26d9c74bc4 [processing] keep only one zonal statistics algorithm 2017-06-29 11:53:04 +07:00
Nyall Dawson
144d733b12 Use a QgsFeedback instead of QProgressBar for QgsNineCellFilter
Gives progress reports and allows cancelation of processing
aspect algorithm
2017-06-29 08:03:57 +10:00
Nyall Dawson
d1a93e0e13 Restore points layer from table algorithm 2017-06-28 17:38:17 +10:00
Mathieu Pellerin
a6b14a0b40 [processing] restore zonal statistics (qgis) alg (#4784) 2017-06-27 18:09:44 +07:00
Nyall Dawson
ae829857ca Restore select by expression algorithm 2017-06-27 13:18:22 +10:00
Nyall Dawson
3a9a0efc33 Resurrect select by attribute algorithm 2017-06-27 11:42:58 +10:00
Nyall Dawson
96c5453ae2 Restore save selected features algorithm 2017-06-27 11:11:54 +10:00
Nyall Dawson
86d33c1875 Restore frequency analysis script
This script has been changed to use a sink output, not the previous
TableWriter csv output.

All algorithms which output flat tables should now still output
feature sinks, to allow correct use in later model steps.
2017-06-27 08:33:13 +10:00
Nyall Dawson
a72eea2256 Fix auto creation of variables when running script algorithms 2017-06-27 08:33:13 +10:00
Nyall Dawson
53e9538ad3 Restore keep n biggest parts script 2017-06-27 08:33:13 +10:00