[processing][grass] v.transform: add missing parameters

-t, -w, -x, -y, -a and -b missing parameters added
This commit is contained in:
Andrea Giudiceandrea 2024-02-13 21:47:30 +01:00 committed by Nyall Dawson
parent 2c58769f64
commit 8309c5ecaa
2 changed files with 38 additions and 0 deletions

View File

@ -10,4 +10,10 @@ QgsProcessingParameterNumber|yscale|Y scale|QgsProcessingParameterNumber.Double|
QgsProcessingParameterNumber|zscale|Z scale|QgsProcessingParameterNumber.Double|1.0|True|None|None
QgsProcessingParameterNumber|zrotation|Rotation around z axis in degrees counterclockwise|QgsProcessingParameterNumber.Double|0.0|True|None|None
QgsProcessingParameterString|columns|Name of attribute column(s) used as transformation parameters (Format: parameter:column, e.g. xshift:xs,yshift:ys,zrot:zr)|None|True|True
*QgsProcessingParameterBoolean|-t|Shift all z values to bottom=0|False
*QgsProcessingParameterBoolean|-w|Swap coordinates x, y and then apply other parameters|False
*QgsProcessingParameterBoolean|-x|Swap coordinates x, z and then apply other parameters|False
*QgsProcessingParameterBoolean|-y|Swap coordinates y, z and then apply other parameters|False
*QgsProcessingParameterBoolean|-a|Swap coordinates after the other transformations|False
*QgsProcessingParameterBoolean|-b|Do not build topology|False
QgsProcessingParameterVectorDestination|output|Transformed

View File

@ -0,0 +1,32 @@
"""
***************************************************************************
v_transform.py
----------
Date : February 2024
Copyright : (C) 2024 by Andrea Giudiceandrea
Email : andreaerdna at libero dot it
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* any later version. *
* *
***************************************************************************
"""
__author__ = 'Andrea Giudiceandrea'
__date__ = 'February 2024'
__copyright__ = '(C) 2024, Andrea Giudiceandrea'
def checkParameterValuesBeforeExecuting(alg, parameters, context):
""" Verify if we have the right parameters """
# -w, -x and -y parameters are mutually exclusive
w = alg.parameterAsBoolean(parameters, '-w', context)
x = alg.parameterAsBoolean(parameters, '-x', context)
y = alg.parameterAsBoolean(parameters, '-y', context)
if sum([w, x, y]) > 1:
return False, alg.tr("The 'Swap coordinates' parameters -w, -x and -y are mutually exclusive. You need to set either none or only one of them!")
return True, None