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 >();
Base class for providing feedback from a processing algorithm.
QList< QgsFeature > QgsFeatureList
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Positive double value (including 0)
bool hasGeometry() const
Returns true if the feature has an associated geometry.
A store for object properties.
QgsGeometry densifyByDistance(double distance) const
Densifies the geometry by adding regularly placed extra nodes inside each segment so that the maximum...
QgsExpressionContext & expressionContext()
Returns the expression context.
Definition for a property.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
Contains information about the context in which a processing algorithm is executed.
static bool isDynamic(const QVariantMap ¶meters, const QString &name)
Returns true if the parameter with matching name is a dynamic parameter, and must be evaluated once f...