23 QString QgsDensifyGeometriesByIntervalAlgorithm::name()
const
25 return QStringLiteral(
"densifygeometriesgivenaninterval" );
28 QString QgsDensifyGeometriesByIntervalAlgorithm::displayName()
const
30 return QObject::tr(
"Densify by interval" );
33 QStringList QgsDensifyGeometriesByIntervalAlgorithm::tags()
const
35 return QObject::tr(
"add,vertex,vertices,points,nodes" ).split(
',' );
38 QString QgsDensifyGeometriesByIntervalAlgorithm::group()
const
40 return QObject::tr(
"Vector geometry" );
43 QString QgsDensifyGeometriesByIntervalAlgorithm::groupId()
const
45 return QStringLiteral(
"vectorgeometry" );
48 QString QgsDensifyGeometriesByIntervalAlgorithm::shortHelpString()
const
50 return QObject::tr(
"Geometries are densified by adding additional vertices on "
51 "edges that have a maximum distance of the interval parameter "
55 QString QgsDensifyGeometriesByIntervalAlgorithm::shortDescription()
const
57 return QObject::tr(
"Creates a densified version of geometries." );
60 QgsDensifyGeometriesByIntervalAlgorithm *QgsDensifyGeometriesByIntervalAlgorithm::createInstance()
const
62 return new QgsDensifyGeometriesByIntervalAlgorithm;
66 QList<int> QgsDensifyGeometriesByIntervalAlgorithm::inputLayerTypes()
const
71 void QgsDensifyGeometriesByIntervalAlgorithm::initParameters(
const QVariantMap &configuration )
73 Q_UNUSED( configuration )
74 std::unique_ptr<QgsProcessingParameterDistance> interval = qgis::make_unique<QgsProcessingParameterDistance>( QStringLiteral(
"INTERVAL" ),
75 QObject::tr(
"Interval between vertices to add" ),
76 1, QStringLiteral(
"INPUT" ),
false, 0, 10000000 );
77 interval->setIsDynamic(
true );
79 interval->setDynamicLayerParameterName( QStringLiteral(
"INPUT" ) );
80 addParameter( interval.release() );
83 QString QgsDensifyGeometriesByIntervalAlgorithm::outputName()
const
85 return QObject::tr(
"Densified" );
94 double interval = mInterval;
95 if ( mDynamicInterval )
96 interval = mIntervalProperty.valueAsDouble( context.
expressionContext(), interval );
107 mInterval = parameterAsDouble( parameters, QStringLiteral(
"INTERVAL" ), context );
110 if ( mDynamicInterval )
111 mIntervalProperty = parameters.value( QStringLiteral(
"INTERVAL" ) ).value<
QgsProperty >();