44 Commits

Author SHA1 Message Date
Bas Couwenberg
2628c480c5 Don't include revision in sources.
Prevent changes to files that weren't changed between releases.
This eases review of the changes between releases significantly.
2019-05-17 16:47:47 +02:00
Nyall Dawson
8cad2a6e16 [processing] Fix random selection count parameter
Remove a bunch of manual "max" values for numeric parameters
where the maximum just represents a 'large number' and not a real
constraint, and let the default parameter max value handling kick in instead.

In the case of random selection the max value exceeded the possible
range for integers in spin boxes and broke the widget.

Fixes #20015
2018-10-05 10:48:17 +10:00
Martin Dobias
1af35b294e Moved new snapping alg as another mode of "Snap geometries" processing alg 2018-09-13 16:24:37 +02:00
Harrissou Sant-anna
00b0e3b0bc [needs-docs] Fix parameter's label and some distance default value
more coherent with meters
2018-08-30 05:10:42 +10:00
Nyall Dawson
304033c916 [processing] Use distance parameter for Points Along Geometry offsets
and Topological Coloring distance parameters

Fixes #19712
2018-08-28 10:21:10 +10:00
Nyall Dawson
249dca7830 [processing] Consist helpful error messages when sinks cannot be created
And throw exceptions always when sinks are not created to avoid
generic errors
2018-04-28 05:50:47 +10:00
Nyall Dawson
5339d62715 [processing] More helpful errors when sources cannot be loaded
Include descriptive text with the specified parameter value
in error, and always check that sources were loaded to avoid
raw Python exceptions when they are not
2018-04-28 05:50:47 +10:00
Nyall Dawson
0dfb3c2d8c [processing] Use distance parameter for more algorithms 2018-04-20 18:27:00 +10:00
Alexander Bruy
dca37abd0e [processing] add group id to QGIS algorithms 2017-12-14 18:04:12 +02:00
Nyall Dawson
928afdd8c5 Fix geometry snapper sometimes creates unwanted overlapping segments
when snapping line layers

Because the default behavior of the snapper is to insert extra
vertices into the snapped geometry in order to make it 'follow'
the reference geometries exactly, this can result in unwanted
results for line layers where the resultant snapped layer
has overlapping line segments.

Since we can't always know what the desired result is that the
user wants (maybe they do want overlapping lines), instead
give them control over the result by exposing extra enum
options which never insert extra vertices.
2017-12-03 07:10:42 +10:00
Nyall Dawson
2a442c7886 Rationalise algorithm groups a bit 2017-08-22 23:36:42 +10:00
Nyall Dawson
d92583c10e Take advantage of auto created outputs in ported algorithms 2017-07-12 07:39:43 +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
f82b41e001 Move an enum to new QgsProcessing class 2017-07-08 20:49:17 +10:00
Nyall Dawson
90f10ae853 Port snap geometries algorithm to new API 2017-07-07 09:28:19 +10:00
Nyall Dawson
b1cadb1822 Use generic algorithm icon for qgis algorithms which do not
have specific icons, instead of generic qgis icon

We consider these 'top level' algorithms, and using the
standard algorithm icon should help reflect this and
differentiate them from 3rd party algorithms.
2017-06-24 12:01:20 +10:00
Nyall Dawson
81855a715b Use FastInsert when adding features from processing 2017-06-23 14:34:38 +10:00
Nyall Dawson
99cfb8faf3 Fix processing algs crash when no source features exist
Instead we output an empty layer - this may be critical for
multi-step models where there is validly no features present
in a source layer
2017-06-23 13:49:32 +10:00
Nyall Dawson
f64f74fb63 Fix incorrect import 2017-06-06 13:41:42 +10:00
Nyall Dawson
4cb7d18b1c Push parameters into processAlgorithm and related functions 2017-06-06 07:41:19 +10:00
Nyall Dawson
77ab933788 Move alg character definitions to __init__ 2017-06-06 07:41:19 +10:00
Nyall Dawson
168f16276c Remove help related methods from GeoAlgorithm 2017-06-06 07:41:19 +10:00
Nyall Dawson
877775d2c0 Remove a bunch of unneeded imports 2017-05-02 14:47:58 +10:00
Nyall Dawson
49c688bbe4 Fix use of QgsProcessingUtils.mapLayerFromString 2017-05-02 13:40:49 +10:00
Nyall Dawson
f84d703234 Add method QgsProcessingUtils::mapLayerFromString
Algorithms and other processing code should use this method
(instead of dataobjects.getLayerFromString) to
retrieve layers from a string, as it considers the processing
context and allows resolving strings to temporarily stored layers.

This permits processing models to function correctly when
intermediate results are stored as memory layers. Subsequent
model algorithms can then access these temporary layers as inputs.
All temporary layers will be removed when the context object
is destroyed after the model algorithm is run.
2017-05-02 12:33:04 +10:00
Nyall Dawson
fd2c18ee16 Refactor processing writer to use QgsFeatureSink, and to store
temporary output layers in the provided processing context

Should fix loss of intermediate memory layers when running
a multi-step model
2017-04-26 17:38:40 +10:00
Nyall Dawson
427c3b1684 Remove vector.features
Use QgsProcessingUtils.getFeatures instead
2017-04-26 12:53:35 +10:00
Nyall Dawson
6397386fda Remove len method from vector.features
Use QgsProcessingUtils::featureCount instead
2017-04-26 12:53:35 +10:00
Nyall Dawson
adc7cf0ec2 Add context argument to vector.features 2017-04-26 12:53:35 +10:00
Nyall Dawson
dd4f530cfb [processing] Pass context argument to processAlgorithm 2017-04-26 12:53:35 +10:00
Nyall Dawson
377b181c4e Port more processing dataobjects methods to c++
Also
- simplify and add tests
- remove large memory leak (persistant store of all non-project layers)
- remove broken support for direct loading postgres/virtual layers
by string (Python version was very broken and would never match
a postgres/virtual layer)
2017-04-05 19:50:46 +10:00
Nyall Dawson
2be4c6a15e Fix failing test 2017-04-03 21:17:45 +10:00
Nyall Dawson
a0bd464232 Use formatted name for algorithm names
Avoids conversion of names later and gives clearer separation
between visible names and internal names
2017-04-03 21:17:45 +10:00
Nyall Dawson
6987d7b37c Port handling of algorithm names to QgsProcessingAlgorithm 2017-04-03 21:17:45 +10:00
Nyall Dawson
dc729c1b5a Move algorithm group handling to QgsProcessingAlgorithm 2017-04-03 21:17:45 +10:00
Nyall Dawson
faa8a653b2 Move algorithm icon handling to QgsProcessingAlgorithm 2017-04-03 21:17:45 +10:00
Nyall Dawson
636e9c5ea3 [FEATURE] Add geometry snapper modes to only snap end points of lines
Allows snapping of end points only, or end point to end point only

Also update processing algorithm to match
2017-03-30 15:52:49 +10:00
Nyall Dawson
92249c1a33 [FEATURE][processing] Snap Geometries algorithm can now snap
within the same layer

Allows closure of gaps within a layer
2017-03-30 13:54:05 +10:00
Juergen E. Fischer
c77172ed3d fix more flake8 warnings 2017-03-05 10:21:24 +01:00
Denis Rouzaud
748be8de71 [spelling] replace behaviour by behavior 2017-01-11 11:35:19 +01:00
Nyall Dawson
ede452be85 [processing] Port feedback object to c++
Algorithms are now passed a QgsProcessingFeedback object
instead of the loosely defined progress parameter.
2017-01-11 11:11:10 +10:00
Nyall Dawson
8acc286b0f [FEATURE] Snap to layer algorithm accepts a mode parameter
With a new option to prefer to snap to closest point on geometry.
The old behaviour was to prefer to snap to nodes, even if a node
was further from the input geometry than a segment. The new option
allows you to snap geometries to the closest point, regardless
of whether it's a node or segment.
2016-11-07 12:20:59 +10:00
Nyall Dawson
dae0a01761 [FEATURE][processing] Snap geometries algorithm allows snapping
to other layer types, supports point/line layers

Fix #14791, #15313
2016-11-07 12:20:59 +10:00
Nyall Dawson
c3a978b9da [FEATURE][processing] Snap geometries to layer algorithm
Port the Geometry Snapper plugin across to the analysis lib, and
expose to python bindings

Add a new algorithm which performs the snapping to layers
2016-11-07 12:20:59 +10:00