Skip to content

Commit

Permalink
Fix parameter names for affine expression function
Browse files Browse the repository at this point in the history
Convention in qgis is underscore_name for expression function
names/parameter names
  • Loading branch information
nyalldawson committed Oct 14, 2021
1 parent e1b0985 commit 0200327
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions resources/function_help/json/affine_transform
Expand Up @@ -5,15 +5,15 @@
"description": "Returns the geometry after an affine transformation. Calculations are in the Spatial Reference System of this geometry. The operations are performed in a scale, rotation, translation order. If there is a Z or M offset but the coordinate is not present in the geometry, it will be added.",
"arguments": [
{"arg":"geometry","description":"a geometry"},
{"arg":"deltaX","description":"x-axis translation"},
{"arg":"deltaY","description":"y-axis translation"},
{"arg":"rotationZ","description":"rotation around z-axis in degrees counter-clockwise"},
{"arg":"scaleX","description":"x-axis scale factor"},
{"arg":"scaleY","description":"y-axis scale factor"},
{"arg":"deltaZ","optional":true,"default":"0","description":"z-axis translation"},
{"arg":"deltaM","optional":true,"default":"0","description":"m-axis translation"},
{"arg":"scaleZ","optional":true,"default":"1","description":"z-axis scale factor"},
{"arg":"scaleM","optional":true,"default":"1","description":"m-axis scale factor"}
{"arg":"delta_x","description":"x-axis translation"},
{"arg":"delta_y","description":"y-axis translation"},
{"arg":"rotation_z","description":"rotation around z-axis in degrees counter-clockwise"},
{"arg":"scale_x","description":"x-axis scale factor"},
{"arg":"scale_y","description":"y-axis scale factor"},
{"arg":"delta_z","optional":true,"default":"0","description":"z-axis translation"},
{"arg":"delta_m","optional":true,"default":"0","description":"m-axis translation"},
{"arg":"scale_z","optional":true,"default":"1","description":"z-axis scale factor"},
{"arg":"scale_m","optional":true,"default":"1","description":"m-axis scale factor"}
],
"examples": [
{ "expression":"geom_to_wkt(affine_transform(geom_from_wkt('LINESTRING(1 1, 2 2)'), 2, 2, 0, 1, 1))", "returns":"'LineString (3 3, 4 4)'"},
Expand Down
18 changes: 9 additions & 9 deletions src/core/expression/qgsexpressionfunction.cpp
Expand Up @@ -7024,15 +7024,15 @@ const QList<QgsExpressionFunction *> &QgsExpression::Functions()
<< QgsExpressionFunction::Parameter( QStringLiteral( "center" ), true ),
fcnRotate, QStringLiteral( "GeometryGroup" ) )
<< new QgsStaticExpressionFunction( QStringLiteral( "affine_transform" ), QgsExpressionFunction::ParameterList() << QgsExpressionFunction::Parameter( QStringLiteral( "geometry" ) )
<< QgsExpressionFunction::Parameter( QStringLiteral( "deltaX" ) )
<< QgsExpressionFunction::Parameter( QStringLiteral( "deltaY" ) )
<< QgsExpressionFunction::Parameter( QStringLiteral( "rotationZ" ) )
<< QgsExpressionFunction::Parameter( QStringLiteral( "scaleX" ) )
<< QgsExpressionFunction::Parameter( QStringLiteral( "scaleY" ) )
<< QgsExpressionFunction::Parameter( QStringLiteral( "deltaZ" ), true, 0 )
<< QgsExpressionFunction::Parameter( QStringLiteral( "deltaM" ), true, 0 )
<< QgsExpressionFunction::Parameter( QStringLiteral( "scaleZ" ), true, 1 )
<< QgsExpressionFunction::Parameter( QStringLiteral( "scaleM" ), true, 1 ),
<< QgsExpressionFunction::Parameter( QStringLiteral( "delta_x" ) )
<< QgsExpressionFunction::Parameter( QStringLiteral( "delta_y" ) )
<< QgsExpressionFunction::Parameter( QStringLiteral( "rotation_z" ) )
<< QgsExpressionFunction::Parameter( QStringLiteral( "scale_x" ) )
<< QgsExpressionFunction::Parameter( QStringLiteral( "scale_y" ) )
<< QgsExpressionFunction::Parameter( QStringLiteral( "delta_z" ), true, 0 )
<< QgsExpressionFunction::Parameter( QStringLiteral( "delta_m" ), true, 0 )
<< QgsExpressionFunction::Parameter( QStringLiteral( "scale_z" ), true, 1 )
<< QgsExpressionFunction::Parameter( QStringLiteral( "scale_m" ), true, 1 ),
fcnAffineTransform, QStringLiteral( "GeometryGroup" ) )
<< new QgsStaticExpressionFunction( QStringLiteral( "buffer" ), QgsExpressionFunction::ParameterList() << QgsExpressionFunction::Parameter( QStringLiteral( "geometry" ) )
<< QgsExpressionFunction::Parameter( QStringLiteral( "distance" ) )
Expand Down

0 comments on commit 0200327

Please sign in to comment.