4766 Commits

Author SHA1 Message Date
Nyall Dawson
2f28736e8e Remove some unused code 2017-06-06 14:38:52 +10:00
Nyall Dawson
a27c22d9b1 Add raster layer output parameters 2017-06-06 14:38:24 +10:00
Nyall Dawson
b75a174780 Rename QgsProcessingFeatureSinkDefinition to QgsProcessingOutputLayerDefinition
Since it also applies to raster layer outputs, we need a more generic name
2017-06-06 13:43:55 +10:00
Nyall Dawson
f64f74fb63 Fix incorrect import 2017-06-06 13:41:42 +10:00
Nyall Dawson
d53fa8d2af Port another alg to new API 2017-06-06 12:36:10 +10:00
Nyall Dawson
ab64428891 Add a cancel button for algorithms which support cancelation 2017-06-06 11:40:33 +10:00
Nyall Dawson
39d20a4cb4 Move algorithm expression context generation to QgsProcessingAlgorithm
Fix error when selecting "from expression" in algorithm parameter dialog
2017-06-06 11:25:09 +10:00
Nyall Dawson
607fed8c48 Restore ability to save outputs directly to Spatialite/PostGIS providers 2017-06-06 10:34:57 +10:00
Nyall Dawson
5e92c0dbf4 Fix saving processing outputs with correct encoding 2017-06-06 09:51:49 +10:00
Nyall Dawson
77072b15ac Rename QgsProcessingFeatureSink to QgsProcessingFeatureSinkDefinition
For consistency with QgsProcessingFeatureSourceDefinition
2017-06-06 08:42:48 +10:00
Nyall Dawson
81da209bf5 Use a QgsProject pointer instead of bool loadIntoProject
Allows potential future use case of loading results into
a different open project
2017-06-06 08:40:23 +10:00
Nyall Dawson
d7aa3f5f7c [processing] Change explicit encoding string parameters to more
flexible QVariantMap creatOptions parameters which include an
optional fileEncoding value

More flexible, allows sinks to be created using any creation
option which is passed to the underlying provider
2017-06-06 08:00:28 +10:00
Nyall Dawson
ea2e477d91 Fix failing tests, temporarily disable some processing tests during
refactoring
2017-06-06 07:41:20 +10:00
Nyall Dawson
7683b25f81 Move getFileFilter from params to gui wrappers 2017-06-06 07:41:20 +10:00
Nyall Dawson
379d060de4 Resurrect another Python QGIS algorithm 2017-06-06 07:41:20 +10:00
Nyall Dawson
a658135693 Remove global processing use selection setting 2017-06-06 07:41:20 +10:00
Nyall Dawson
7f687345f8 [FEATURE][processing] Add checkbox for each vector input layer
to control whether selected features only are to be used

Replaces the old global setting and makes it immediately obvious
to users when the selection will be respected
2017-06-06 07:41:20 +10:00
Nyall Dawson
46596c50f2 Restore correct layer naming when loading results 2017-06-06 07:41:20 +10:00
Nyall Dawson
5b9d925c70 Fix loading of results after running algorithms 2017-06-06 07:41:20 +10:00
Nyall Dawson
f9887aabf5 [processing] Remove more UseSelectionIfPresent use 2017-06-06 07:41:20 +10:00
Nyall Dawson
d85522582a Temporarily deactivate more algorithms 2017-06-06 07:41:20 +10:00
Nyall Dawson
b6fb41d4ee [processing] Don't use vector layers directly as feature sources
Instead, parameters evaluate to QgsFeatureSource, which are
used for retrieving features, feature count, crs, wkb type,
etc.

This abstracts away the actual feature source, so that
algorithms may potentially operate from non-layer
feature sources.

It also helps remove the need for specialised QgsProcessingUtils
methods like getFeatures, featureCount, and createSpatialIndex.
Instead the standard API methods using QgsFeatureSources can
be used instead.
2017-06-06 07:41:20 +10:00
Nyall Dawson
5b8affcb56 Rename QgsProcessingParameterOutputVectorLayer to QgsProcessingParameterFeatureSink 2017-06-06 07:41:20 +10:00
Nyall Dawson
770c45da12 Rename QgsProcessingParameterVectorLayer to QgsProcessingParameterFeatureSource
Helps abstract away sources to allow non vector layer sources in future
2017-06-06 07:41:20 +10:00
Nyall Dawson
ffce9c9f1e Add direct method to retrieve QgsFeatureSink from parameter 2017-06-06 07:41:20 +10:00
Nyall Dawson
937347582c Indentation 2017-06-06 07:41:20 +10:00
Nyall Dawson
a951424287 QgsProcessingParameterVectorLayer accepts lists of vector layer types 2017-06-06 07:41:19 +10:00
Nyall Dawson
bdf051a03a Partially port a trial python alg to new API 2017-06-06 07:41:19 +10:00
Nyall Dawson
0c3ad14c79 Adapt more python code to new API 2017-06-06 07:41:19 +10:00
Nyall Dawson
6517470ddd Temporarily fix memory layer outputs 2017-06-06 07:41:19 +10:00
Nyall Dawson
87fc31d6de Adapt more python code to new API 2017-06-06 07:41:19 +10:00
Nyall Dawson
28f7a8b7e1 Move expression context generation out of parameters 2017-06-06 07:41:19 +10:00
Nyall Dawson
416770b197 Remove no longer required _resolveLayers method 2017-06-06 07:41:19 +10:00
Nyall Dawson
ba03f1a13a Move minimum layer extent calculation to c++ 2017-06-06 07:41:19 +10:00
Nyall Dawson
189f804714 Adapt more code to c++ API 2017-06-06 07:41:19 +10:00
Nyall Dawson
ef59d0c454 Port parameter checking to c++ 2017-06-06 07:41:19 +10:00
Nyall Dawson
c1d9d57dd2 First working pure c++ algorithms 2017-06-06 07:41:19 +10:00
Nyall Dawson
4cb7d18b1c Push parameters into processAlgorithm and related functions 2017-06-06 07:41:19 +10:00
Nyall Dawson
f1c53c3aa4 Refactor Algorithm setParamValues -> getParamValues
Now returns a dict of parameter inputs for the algorithm
2017-06-06 07:41:19 +10:00
Nyall Dawson
9997ab6e1e Partially port wrappers to QgsProcessingParameterDefinition
And create a new WidgetWrapperFactory for creating a suitable wrapper
corresponding to a parameter
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
134c04b8bb Move getParametersPanel out of algorithm class
It's a gui related method, so shouldn't be in core class
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
2d1579d28a Port algorithm help to QgsProcessingAlgorithm 2017-06-06 07:41:19 +10:00
Nyall Dawson
1e788556f0 Port getCustomParametersDialog to QgsProcessingAlgorithm 2017-06-06 07:41:19 +10:00
Nyall Dawson
fb811766f8 Add framework for algorithm outputs
This somewhat changes the meaning of outputs from processing 2.x.
In 2.x processing outputs were used both as a method of specifying
inputs to algorithms (file paths to destination layers created
by the algorithm) AND pure outputs (such as statistics calculated
by the algorithm).

This is now split. The old input-type-outputs (destination layers)
are now input parameters (since the parameter value IS an input to the
algorithm). To differentiate them from parameters indicating pure
input layers a new "isDestination()" method was added to
QgsProcessingParameterDefinition.

Output definitions are now purely indications of values CREATED
by the algorithms. Suitable candidates are the existing calculated
stats and actual file path/URI of any layers created by the algorithm.
Moving forward we should ensure all algorithms output as much
useful information as possible - e.g. number of features processed,
number of skipped features, count null geometries encountered, etc...
2017-06-06 07:41:19 +10:00
Nyall Dawson
fac8ca4d4f Move execution check to QgsProcessingAlgorithm 2017-06-06 07:41:19 +10:00
Nyall Dawson
03e40f7497 [processing] Remove all remaining algorithm copies
Algorithms are no longer copied - just a single const instance
of each algorithm is used
2017-06-06 07:41:19 +10:00
Nyall Dawson
b64a71df61 Port algorithm countVisibleParameters to c++ 2017-06-06 07:41:19 +10:00
Nyall Dawson
2da85f8771 Temporarily deactivate all processing providers/algorithms
While the processing API is in such a state of flux it's
become unmaintainable to port these algorithms change-by-change.
Instead, disable them all until the API is fixed, and then we
can port them algorithm by algorithm and reactivate each
test in turn.
2017-06-06 07:41:19 +10:00