451 Commits

Author SHA1 Message Date
Nyall Dawson
3a2710efe5 Merge pull request #4870 from nyalldawson/algs3
Port 4 more algs to new API
2017-07-17 07:51:47 +10:00
Nyall Dawson
6487fbb2d1 Port Reverse Line Direction to new API, add test 2017-07-17 07:24:33 +10:00
Nyall Dawson
9cbc8cc20f Port Offset line, Orthogonalize and Pole of Inaccessibility to new API
Improvements:
- Fix handling of multiline outputs for Offset Line algorithm
2017-07-16 20:39:43 +10:00
Nyall Dawson
23a4d6028a Merge pull request #4868 from nyalldawson/nn
Port Remove Null Geometries algorithm to c++/new API
2017-07-16 20:20:23 +10:00
Matthias Kuhn
102188aca4 Port PointOnSurface QGIS algorithm 2017-07-16 10:35:47 +02:00
Nyall Dawson
5deb8fcb87 Port Remove Null Geometries algorithm to c++/new API
Enhancements:
- add a new optional output for null geometries, and make
the non-null geometry output optional. This allows the algorithm
to act as a router for features with null/not null geometries
inside of a model
2017-07-16 17:56:10 +10:00
Nyall Dawson
1b1dc7de63 Port Extract Nodes to new API
Improvements:
- Retain Z/M values from input geometries
2017-07-16 15:55:05 +10:00
Nyall Dawson
ea06500caf Port Unique Values algorithm to new API
Improvements:
- by default output a table with unique values, instead of a HTML
file. This allows the values to be more easily used in follow up
analysis (e.g. in a model). HTML output is still available, but
not output by default
2017-07-15 22:07:12 +10:00
Nyall Dawson
b7f888bf5b Port Distance Matrix algorithm to new API
Enhancements:
- support source/target layers in different CRS
- output layers with geometry (i.e. keep input point geometry - avoids
need to rejoin result back to original table to get geometry)
- keep original data types for id fields
- don't fire off many single feature requests - instead request
multiple features at once to improve speed
2017-07-15 20:33:53 +10:00
Nyall Dawson
7f58af11ae Port mean coords algorithm to new API
Improvements:
- Don't export UID class field if no class field was set
2017-07-15 20:33:08 +10:00
Nyall Dawson
a6736ceb77 Add ability to select output fields from both layers to Intersection algorithm 2017-07-15 17:40:45 +10:00
Nyall Dawson
02bf88c4b7 Port Line Intersection algorithm to new API
Improvements
- allow different CRS between layers
- instead of optionally allowing selection of a single field to keep from
both inputs, allow selection of multiple fields
2017-07-15 17:40:45 +10:00
Alexander Bruy
671f024789 fix tests 2017-07-15 09:30:21 +03:00
Alexander Bruy
f3f9e544ab [processing] restore Hillshade algorithm 2017-07-15 09:29:35 +03:00
Alexander Bruy
f4bba54a11 [processing] restore Ruggedness algorithm 2017-07-15 09:29:35 +03:00
Alexander Bruy
05b4cc22bf [processing] restore Slope algorithm 2017-07-15 09:29:35 +03:00
Nyall Dawson
2e8b84867e Port sum line length algorithm to new API
and implement auto reprojection of lines to polygon layer CRS
2017-07-15 15:56:04 +10:00
Nyall Dawson
dd38c52dd8 [needs-docs] Copy unique class field option from Points in Polygons Unique
to Points in Polygons

Again, it doesn't make sense for a whole separate algorithm just to
add a single option
2017-07-15 14:50:15 +10:00
Nyall Dawson
b67e525f29 [needs-docs] Add optional weight field to Points In Polygon algorithm
Instead of a separate Points In Polygon algorithm just for this
extra option, add it to the original Points In Polygon algorithm
as a non-default option.
2017-07-15 14:50:10 +10:00
Nyall Dawson
68687c1e04 Port counts points in polygon alg to new API
and add auto-reprojection support if points layer is in
different CRS to polygon layer
2017-07-15 14:23:07 +10:00
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
Alexander Bruy
b01ffa5cd4 [processing] add test for heatmap algorithm 2017-07-13 12:11:42 +03:00
Alexander Bruy
56208540f9 [processing] remove GeoAlgorithmExecutionException 2017-07-13 09:02:24 +03:00
Mathieu Pellerin
d3ad9131f4 [processing] restore intersection algorithm (#4849) 2017-07-13 11:07:01 +07:00
Nyall Dawson
91d6ac9537 Update script algorithms for auto output creation 2017-07-12 07:50:13 +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
f49b603443 Split QgsProcessingModelAlgorithm into separate components
The cpp/h file was getting too large, so split off the individual
subcomponents into their own h/cpp files to keep code
maintainable.
2017-07-08 20:49:17 +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
05e8928e30 Use native algorithms for processing tests where possible
And fix a few issues in the dissolve algorithm
2017-07-07 13:49:43 +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
05364aa5f0 When running algorithm tests, if two parameters share the same
layer source, ensure that the actual parameter values point
to the same layer
2017-07-07 09:28:19 +10:00
Nyall Dawson
ab06973d6a Don't try to load default styles in processing test layers 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
274d684f64 Fix procesing test layer loading 2017-07-07 09:28:19 +10:00
Nyall Dawson
b917a82662 Better debuging from processing alg tests 2017-07-07 09:28:19 +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
Nyall Dawson
1b2afea23e Add some more clone methods to algorithm subclasses 2017-07-07 09:26:17 +10:00
Nyall Dawson
8379f9bb98 Merge pull request #4791 from nyalldawson/reproj_test
Use native projection algorithm for unit test
2017-06-29 09:30:16 +10:00
Nyall Dawson
468e44dc3a Use native projection algorithm for unit test 2017-06-29 08:33:34 +10:00
Nyall Dawson
d2b9652d4b Fix use of direct map layers as inputs for source parameters 2017-06-29 08:00:47 +10:00
Nyall Dawson
d1a93e0e13 Restore points layer from table algorithm 2017-06-28 17:38:17 +10:00
Nyall Dawson
7f7842a11d Merge pull request #4783 from nyalldawson/script
processing: restore script algorithm provider and tests
2017-06-27 14:15:36 +10:00
Nyall Dawson
e171fe30c0 Restore script based algorithm tests 2017-06-27 13:18:22 +10:00
Nyall Dawson
792a252ef8 Fix script algorithm centroids tests 2017-06-27 11:12:20 +10:00
Nyall Dawson
1468eef635 Merge pull request #4781 from nyalldawson/centroid_tests
Reenable centroid algorithm tests
2017-06-27 10:34:23 +10:00
Nyall Dawson
11f42eb432 Reenable centroid algorithm tests 2017-06-27 09:46:56 +10:00