184 Commits

Author SHA1 Message Date
David Marteau
f2b8e6970b Support point and rectangle as geometry parameter values 2020-09-15 07:39:10 +10:00
David Marteau
4eb931e890 Add geometry processing parameter 2020-09-15 07:39:10 +10:00
vcloarec
5ffc4f298a some fixes and add tests 2020-09-10 14:03:11 -04:00
vcloarec
07714f3931 port alg to c++
and minor fixes
2020-09-10 14:03:11 -04:00
Nyall Dawson
b9f1f2ca32 [processing] Fix destination layer name ignored in Load Layer into Project
algorithm

Fixes #38046
2020-07-31 16:03:16 +10:00
Nyall Dawson
d57a638ec4 Add a processing algorithm flag to indicate that an algorithm requires
a valid project to be set in the context in order to execute

And flag a bunch of algorithms which require this
2020-07-30 08:26:40 +10:00
Nyall Dawson
937a41a656 [processing] Add a flag for algorithms to indicate that they should
not be available from the standalone qgis_process tool (e.g. "select by "
algorithms, which have no meaning outside of a GUI application)

These algorithms are hidden from the algorithm list for qgis_process
and cannot be run by the tool
2020-07-30 08:26:40 +10:00
Nyall Dawson
03854a41b0 Add explicit settings for ellipsoid, distance and area units to QgsProcessingContext
to avoid having to always retrieve these via the context's project (which may
not be available in some circumstances)

Refs #37988
2020-07-30 08:26:40 +10:00
nirvn
8c61a803fc [FEATURE][processing] Add a save features to file algorithm 2020-07-22 19:11:50 +07:00
Nyall Dawson
398b55ec67 Use correct layer comparators when comparing layer sources in processing
Fixes #37394
2020-07-06 13:59:21 +10:00
Denis Rouzaud
0cb8408425
more flags warnings fixes for Qt 5.15 (#37309)
* more flags warnings fixes for Qt 5.15

* fix sip compilation
2020-06-19 12:02:00 +02:00
Denis Rouzaud
044a05d828 run sipify 2020-06-19 08:47:23 +10:00
Nyall Dawson
81a9db9f57 [sipify] Fix creation of cross references 2020-06-15 13:43:58 +10:00
Nyall Dawson
e81af2c9e1 [processing] Add metadata setting for file destination parameters
to avoid file overwrite confirmation prompt

Fixes #37011
2020-06-09 04:02:32 +10:00
Nyall Dawson
4fdfa949cf [processing] Start porting Aggregates parameters to C++
Port parameter type to c++
2020-06-03 15:17:56 +10:00
Nyall Dawson
c77436d71e Dox 2020-06-02 08:43:54 +10:00
Nyall Dawson
dbe9aa0902 [processing] Port Refactor Fields to c++
Having this core algorithm in Python has proved just too unreliable

Refs #36706, refs #36843
2020-06-02 08:43:54 +10:00
Nyall Dawson
191e362ed4 Move FieldMapper parameter type to c++
Fixes sip "forgeting" about Python overrides for the type definition

Refs #36706
2020-06-02 08:43:54 +10:00
Nyall Dawson
95387cfa3b Add map support to QgsProcessingUtils::variantToPythonLiteral 2020-06-02 08:43:54 +10:00
Martin Dobias
ab2ec699e9 Clean up doxygen doc so that types are not mistaken as html tags 2020-05-08 12:55:08 +02:00
Martin Dobias
299be94459 Review fixes 2020-05-08 12:55:08 +02:00
Mathieu Pellerin
5843fc4e34 Follow up commit ff2b2e8 : safer approach + test case 2020-04-27 06:28:47 +10:00
Nyall Dawson
6a1a2e9af0 [processing] Fix handling of vrt, SAGA tif output file names
Fixes #35755, fixes #35770
2020-04-17 16:18:09 +10:00
Nyall Dawson
3b3c7d8012 Hookup model logic for correct skipping of branches which shouldn't be run 2020-04-16 16:02:53 +10:00
Nyall Dawson
6a1b10686b [FEATURE][processing] New modeler algorithm for conditional branches in models
This algorithm allows useres to setup multiple conditions (via qgis expressions),
which cause their corresponding branch of the model to be run or skipped
depending on the result of the expression evaluation.

Sponsored by Andreas Neumann
2020-04-16 16:02:53 +10:00
Nyall Dawson
e3955df564 Add method to model API to get available dependencies for a child algorithm 2020-04-16 16:02:53 +10:00
Nyall Dawson
b2167594fe Make handling of processing child algorithm dependencies more flexible
Instead of just using child ID strings, use a new dedicated class to
store dependency information
2020-04-16 16:02:53 +10:00
Nyall Dawson
7fd72f3b4e [FEATURE][processing] Allow reordering model inputs
Instead of forcing a quasi-random ordering of inputs for models,
this commit exposes a new "Reorder Model Inputs" option in the model
designer which allows users control over the exact order of
inputs to show users for their model.

No more illogical ordering like showing a field choice before the
layer choice it's based on!

Sponsored by NaturalGIS
2020-04-16 06:03:48 +10:00
Nyall Dawson
b9a99890b4 Add method to validate a whole model 2020-04-14 20:27:21 +10:00
Nyall Dawson
9f7c7fcb35 Add method to validate a child algorithm in a model
Checks that the algorithm has valid values for all inputs
2020-04-14 20:27:21 +10:00
Nyall Dawson
47f96e2466 [FEATURE][processing] Allow copying/cut/paste of model components
This commit allows users to copy and paste model components, both
within the same model and between different models
2020-04-14 14:36:02 +10:00
Nyall Dawson
0396162d1f [processing] De-emphasise SAGA results when searching in toolbox
This change "dims" the results from the SAGA provider when a search
is made in the toolbox, to visually push users towards picking alternative
algorithms instead.

The Processing implementation of SAGA algorithms are a constant source
of critical bugs for users, causing incorrect analysis results. There's
zero community interest in actively maintaining this provider, so we
need to take steps to push users to stop picking these algorithms
wherever alternative (QGIS/GRASS/GDAL based) equivalents exist.

And for 4.0, seriously re-consider dropping this provider from the
out of the box install. We are causing more harm then good by offering
it to users.
2020-04-13 17:12:14 +10:00
Nyall Dawson
bb9b25f28b Add API to flag that a sink supports appending features to existing layers 2020-04-07 17:05:44 +10:00
Nyall Dawson
b2ca789ba4 Implement sinkProperties for QgsProcessingFeatureBasedAlgorithm subclasses 2020-04-07 17:05:44 +10:00
Nyall Dawson
2d8da255a2 [processing] Add API to determine in advance the properties of vector
outputs (sinks and vector layers), such as output fields, wkbtypes and
crs.
2020-04-07 17:05:44 +10:00
Nyall Dawson
0d7773a0ee [processing] Allow setting the optional remapping definition for QgsProcessingOutputLayerDefinition
Provides a (currently non-functional) API for specifying optional remapping parameters
for vector outputs.
2020-04-07 17:05:44 +10:00
Nyall Dawson
a7610c5682 Give up on enum class
Python says no.
2020-04-02 19:20:40 +10:00
Nyall Dawson
d20a3bddc0 [FEATURE][processing] Port output parameter wrappers to new c++ API for modeler
This allows a range of new possibilities, including:
- models with static outputs for child algorithms, e.g. always saving
a child algorithm's output to a geopackage or postgres layer
- models with expression based output values for child algorithms, e.g.
generating an automatic file name based on today's date and saving
outputs to that file
2020-04-02 02:29:54 +10:00
Nyall Dawson
f31af07235 Fix windows build 2020-04-01 18:20:09 +10:00
Nyall Dawson
4fa9083cf6 [FEATURE][processing] Allow creation of group boxes in models
These are a visual guide, allowing designers to create logical groups
of algorithms relating to a single task ("eg 'Prepare data')

The title and color of the group boxes can be customized
2020-04-01 18:20:09 +10:00
Nyall Dawson
a7a64d40e0 Add API for storing group boxes in processing models 2020-04-01 18:20:09 +10:00
Nyall Dawson
e788be93fa [processing][FEATURE] Add api for setting model component colors, and expose
the option to set manual colors for individual model comments
2020-04-01 18:20:09 +10:00
Nyall Dawson
60af337c3c [processing][FEATURE] Add "Save Log to File" algorithm for models
This algorithm saves the contents of the execution log (right up to
the point in the model at which the 'save log' algorithm executes)
to a file.

It can be used to automatically store the debugging log when running
models for later reference and transparency.
2020-03-31 19:35:28 +10:00
Nyall Dawson
0684d41fe1 Make QgsProcessingFeedback remember logged messages for later recall 2020-03-31 19:35:28 +10:00
Nyall Dawson
e386573c0c [FEATURE][processing] Port multi-layer input parameter widget to new API
Allows
- expression based inputs
- rearrangement of inputs for multi-layer parameters in models, to set
specific layer orders
2020-03-31 01:06:48 +10:00
Nyall Dawson
c85f62a968 Make more use of layer type hints to avoid trying to open raster/mesh
layers using the ogr provider
2020-03-31 01:06:48 +10:00
Nyall Dawson
320fecce00 [processing] Add method to encode and decode a combined provider key and uri
to a single string

We need this to allow processing inputs to load non gdal/ogr/mdal sources, such
as being able to directly read postgis layers without loading them into a project first
2020-03-26 11:55:45 +10:00
Nyall Dawson
1915a16bf3 Port extent parameter to new c++ API widget wrapper 2020-03-25 19:25:40 +10:00
Nyall Dawson
488c8c739a Fix loss of callback when invalid geometry handling method is set through
source definition
2020-03-25 09:42:17 +10:00
Nyall Dawson
afbe727c1a Allow serialization of QgsProcessingFeatureSourceDefinition through QgsXmlUtils 2020-03-25 09:42:17 +10:00