23QString QgsDensifyGeometriesByIntervalAlgorithm::name()
const
25 return QStringLiteral(
"densifygeometriesgivenaninterval" );
28QString QgsDensifyGeometriesByIntervalAlgorithm::displayName()
const
30 return QObject::tr(
"Densify by interval" );
33QStringList QgsDensifyGeometriesByIntervalAlgorithm::tags()
const
35 return QObject::tr(
"add,vertex,vertices,points,nodes" ).split(
',' );
38QString QgsDensifyGeometriesByIntervalAlgorithm::group()
const
40 return QObject::tr(
"Vector geometry" );
43QString QgsDensifyGeometriesByIntervalAlgorithm::groupId()
const
45 return QStringLiteral(
"vectorgeometry" );
48QString 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 "
55QString QgsDensifyGeometriesByIntervalAlgorithm::shortDescription()
const
57 return QObject::tr(
"Creates a densified version of geometries." );
60QgsDensifyGeometriesByIntervalAlgorithm *QgsDensifyGeometriesByIntervalAlgorithm::createInstance()
const
62 return new QgsDensifyGeometriesByIntervalAlgorithm;
66QList<int> QgsDensifyGeometriesByIntervalAlgorithm::inputLayerTypes()
const
71void QgsDensifyGeometriesByIntervalAlgorithm::initParameters(
const QVariantMap &configuration )
73 Q_UNUSED( configuration )
74 std::unique_ptr<QgsProcessingParameterDistance> interval = std::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() );
83QString 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 >();
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
bool hasGeometry() const
Returns true if the feature has an associated geometry.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
QgsGeometry densifyByDistance(double distance) const
Densifies the geometry by adding regularly placed extra nodes inside each segment so that the maximum...
Contains information about the context in which a processing algorithm is executed.
QgsExpressionContext & expressionContext()
Returns the expression context.
Base class for providing feedback from a processing algorithm.
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...
@ TypeVectorLine
Vector line layers.
@ TypeVectorPolygon
Vector polygon layers.
Definition for a property.
@ DoublePositive
Positive double value (including 0)
A store for object properties.
QList< QgsFeature > QgsFeatureList