95 Commits

Author SHA1 Message Date
Alexander Bruy
f801cb6816 [processing] new pont cloud parameter for processing 2021-08-05 16:03:50 +03:00
Nyall Dawson
8f36cdfa44 [processing] Add API to allow a string parameter to show as a combobox
with preset choices in processing GUI

In some circumstances it is desirable to restrict the values available
when a user is asked to enter a string parameter to a list of predetermined
"valid" values, yet these values will vary installation by installation
(e.g. a "printer name" parameter, where you want users to pick from
printers installed on the system, but since the printer names will
vary install to install an enum parameter is not a valid choice)

This can now be done by setting the widget wrapper metadata
"value_hints" option, as demonstrated below. (While this provides a mechanism
for guiding users to select from valid string values when running a Processing
algorithm through the GUI, it does not place any limits on the string values
accepted via PyQGIS codes or when running the algorithm via other non-gui
means. Algorithms should gracefully handle other values accordingly.)

    param = QgsProcessingParameterString( 'PRINTER_NAME', 'Printer name')
    # show only printers which are available on the current system as options
    # for the string input.
    param.setMetadata( {'widget_wrapper':
      { 'value_hints': ['Inkjet printer', 'Laser printer'] }
    })
2021-08-01 05:33:51 +10:00
nirvn
6b993f6b98 [FEATURE][processing] Brand new duration parameter 2021-07-27 13:46:09 +07:00
Nyall Dawson
711a615be3 Fix raises sphinx format 2021-06-25 10:50:04 +10:00
Nyall Dawson
4ff3f447dc Don't try to insert links in raises blocks in PyQGIS docs
These aren't formatted correctly if we do
2021-06-10 11:03:43 +10:00
Nyall Dawson
d3870937b2 [processing] When exporting a model to a python script, include
helpful comments next to all static enum parameter values used
in child algorithms with the corresponding text.

I.e. instead of

  alg_params = {
    'END_CAP_STYLE': 2,
  }

we now export

  alg_params = {
    'END_CAP_STYLE': 2,  # Flat
  }

Much more readable!
2021-04-09 11:45:53 +10:00
David Marteau
9eb172aa8e Add multipart option for processing geometry parameter 2021-03-31 08:59:20 +10:00
Denis Rouzaud
ba8a445850 run sipify 2021-03-22 21:13:52 +01:00
Nyall Dawson
7dfef3a0b1 Newer doxygen versions don't auto convert the first line in a class'
documentation to a brief note, so we have to do it explicitly...
2021-02-19 08:15:29 +10:00
Nyall Dawson
50b9beaad6 [sipify] Catch more class references and insert :py:class: annotations 2021-01-31 05:41:22 +10:00
Nyall Dawson
b740bf201a [processing] Fix exception when calling "Select from Files" in batch mode
on a file parameter

Fixes #40705
2021-01-05 08:32:10 +10:00
Nyall Dawson
83ccb6554e [processing] Add method to set an explicit override for the default
value of a parameter for the GUI only

This allows us freedom to change the default settings for an algorithm
shown when opening the algorithm in the toolbox/batch/model without
changing the underlying default value used for the parameter in the
raw API (which we can't do easily without potentially breaking 3rd
party scripts/plugins)
2020-11-24 13:11:37 +10:00
Alexander Bruy
cc98fe30d9 support static (non-translated) strings as enum values in Processing 2020-11-19 19:33:18 +02:00
Vincent Cloarec
1fbba79a0f
Mesh export processes, first part : infrastructure and export vertices (#39664)
[processing] Infrastructure for QgsMeshLayer to add processing algorithms, dataset group paramater and dataset time parameter to allow the user to easily choose a dataset.
2020-11-03 06:05:28 +01:00
Alexander Bruy
ee241edb87 completely hide parameter type definition from SIP 2020-11-02 09:50:05 +02:00
Alexander Bruy
5a155f7c23 make QgsProcessingParameterDxfLayers public 2020-11-02 09:49:05 +02:00
Alexander Bruy
2f9236b254 remove from SIP some parameter type definitions 2020-11-02 07:49:04 +10:00
Alexander Bruy
5271ca26f5 make QgsProcessingParameterVectorTileWriterLayers public
hide parameter types definitions for TIN and vector tile parameters from
SIPP
2020-11-02 07:49:04 +10:00
Alexandre Neto
279c499bb1 Fix QgsProcessingParameterNumber docstring example
(cherry picked from commit 66011b22ce181c93aebeda1f0c320f254a67ca30)
2020-09-25 10:58:12 +10:00
Nyall Dawson
ed6e9ac84c Dox++ 2020-09-21 11:05:34 +10:00
Etienne Trimaille
6076950c68 Add help string for parameters in Processing 2020-09-21 11:05:34 +10:00
David Marteau
518e48c12f Fix python serialization for geometry processing parameter
Fix regexp for referenced geometry parsing
    Fix suggested doc strings
2020-09-15 07:39:10 +10:00
David Marteau
6262965df9 Register meta type for geometry processing parameter
Fix QgsProcessingParameterGeometry argument list
2020-09-15 07:39:10 +10:00
David Marteau
aa0a8ab628 Add geometry filter for processing geometry parameter 2020-09-15 07:39:10 +10:00
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
07714f3931 port alg to c++
and minor fixes
2020-09-10 14:03:11 -04: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
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
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
bb9b25f28b Add API to flag that a sink supports appending features to existing layers 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
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
1915a16bf3 Port extent parameter to new c++ API widget wrapper 2020-03-25 19:25:40 +10:00
Nyall Dawson
afbe727c1a Allow serialization of QgsProcessingFeatureSourceDefinition through QgsXmlUtils 2020-03-25 09:42:17 +10:00
Nyall Dawson
6e2c21eb55 [processing] Cleanup handling of "iterate over source" buttons, move
creation completely to widget wrapper
2020-03-25 09:42:17 +10:00
Nyall Dawson
b0474d7fd3 [processing] Hookup backend API allowing features sources to be
limited to a specific maximum number of features, and allowing
per-source overriding of the default "invalid geometry" handling behavior
2020-03-24 10:53:50 +10:00
Nyall Dawson
517aa9667b [processing] Port DestinationSelectionPanel to c++
This is basically a 1:1 port (+some fixes relating to incorrect signal
emissions and many more tests)
2020-03-17 07:24:40 +10:00
Nyall Dawson
edd0635fe3 [processing] Move responsiblity for creation of file filter strings from python to c++ 2020-03-16 10:08:46 +10:00
Alexander Bruy
47070a7d7b
Merge pull request #35076 from alexbruy/maplayer-datatype
Data type support for QgsProcessingParameterMapLayer
2020-03-15 16:14:20 +02:00
Nyall Dawson
7b1975ba83 Optionally allow entry of new table names in table name parameter 2020-03-14 16:57:14 +10:00
Nyall Dawson
513966ca80 [feature][processing] Add dedicated parameter type for database tables
Allows selection of an existing database table for a specific
database provider connection (the provider must implement the connections API)
2020-03-14 16:57:14 +10:00
Nyall Dawson
93c917f7b6 [feature][processing] Add dedicated parameter type for database schemas
Allows selection from the existing database schema for a specific
database provider connection (the provider must implement the connections API)
2020-03-14 16:57:14 +10:00
Alexander Bruy
0181d10080 [feature][processing] data types support for map layer parameter.
Allow to define accepted layer types for map layer parameters, for
example vector points and rasters.
2020-03-14 08:51:02 +02:00