23 QString QgsSetMValueAlgorithm::name()
const
25 return QStringLiteral(
"setmvalue" );
28 QString QgsSetMValueAlgorithm::displayName()
const
30 return QObject::tr(
"Set M value" );
33 QStringList QgsSetMValueAlgorithm::tags()
const
35 return QObject::tr(
"set,add,m,measure,values" ).split(
',' );
38 QString QgsSetMValueAlgorithm::group()
const
40 return QObject::tr(
"Vector geometry" );
43 QString QgsSetMValueAlgorithm::groupId()
const
45 return QStringLiteral(
"vectorgeometry" );
48 QString QgsSetMValueAlgorithm::shortHelpString()
const
50 return QObject::tr(
"This algorithm sets the M value for geometries in a layer.\n\n"
51 "If M values already exist in the layer, they will be overwritten "
52 "with the new value. If no M values exist, the geometry will be "
53 "upgraded to include M values and the specified value used as "
54 "the initial M value for all geometries." );
57 QString QgsSetMValueAlgorithm::outputName()
const
59 return QObject::tr(
"M Added" );
62 QgsSetMValueAlgorithm *QgsSetMValueAlgorithm::createInstance()
const
64 return new QgsSetMValueAlgorithm();
67 bool QgsSetMValueAlgorithm::supportInPlaceEdit(
const QgsMapLayer *l )
const
69 const QgsVectorLayer *layer = qobject_cast< const QgsVectorLayer * >( l );
86 void QgsSetMValueAlgorithm::initParameters(
const QVariantMap & )
89 mValueParam->setIsDynamic(
true );
91 mValueParam->setDynamicLayerParameterName( QStringLiteral(
"INPUT" ) );
92 addParameter( mValueParam.release() );
97 mMValue = parameterAsDouble( parameters, QStringLiteral(
"M_VALUE" ), context );
100 mMValueProperty = parameters.value( QStringLiteral(
"M_VALUE" ) ).value<
QgsProperty >();
114 newGeometry->dropMValue();
117 if ( mDynamicMValue )
120 newGeometry->addMValue( m );