Closed rldhont closed 3 years ago
This seems like a really nice addition. Looking at the code, it is well done, tests are passing and it is backwards compatabile. So 👍 from me.
@nyalldawson is this conceptually ok? It adds another layer of complexity into script definition, but definitely offers something that experience users (myself included) want. I am happy to handle the pull request and everything just wanted your say-so on this.
@JanCaha
is this conceptually ok?
I think so. A quick summary of my thoughts:
Ok, that is pretty much what I have in mind.
@rldhont or @Gustry could you please edit the web page in such way this new approach is summarized under # Advanced Script syntax
in script-syntax.md
? So that we have the descriptions for original approach and then this new one?
Then I think we can bump the version to 3.0.0, do some testing and ask Nyall to make a new release.
@JanCaha done.
The default inputs to R script are based on the QGIS parameter
asScriptCode
/fromScriptCode
string definition.QGIS also provide an other way to describe processing parameters used in GRASS7, SAGA and other processing providers. We propose to reuse this capability. The metadata line looks like
QgsProcessingParameter|name|description|other_parameters_separated_by_pipe
.The inputs can look like this:
##QgsProcessingParameterFeatureSource|INPUT|Vector layer
specifies that there will be variableINPUT
that will be a vector.##QgsProcessingParameterField|FIELDS|Attributes|None|INPUT|-1|False|False
specifies that there will be variableFIELDS
that will be a field index.##QgsProcessingParameterRasterLayer|INPUT|Grid
specifies that there will be variableINPUT
that will be a raster.##QgsProcessingParameterNumber|SIZE|Aggregation Size|QgsProcessingParameterNumber.Integer|10
specifies that there will be variableSize
that will be numeric, and a default value forSize
will be10
.##QgsProcessingParameterEnum|METHOD|Method|[0] Sum;[1] Min;[2] Max
specifies that there will be variableMETHOD
that will be a value provided under[]
.##QgsProcessingParameterVectorDestination|OUTPUT|Result
specifies that there will be variableOUTPUT
that will be the destination vector layer.