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( 
"This algorithm takes a polygon or line layer and generates a new one " 
   51                      "in which the geometries have a larger number of vertices than the original one.\n\n" 
   52                      "Geometries are densified by adding additional vertices on " 
   53                      "edges that have a maximum distance of the interval parameter " 
   57QString QgsDensifyGeometriesByIntervalAlgorithm::shortDescription()
 const 
   59  return QObject::tr( 
"Creates a densified version of geometries by setting a maximum distance for segments." );
 
   62QgsDensifyGeometriesByIntervalAlgorithm *QgsDensifyGeometriesByIntervalAlgorithm::createInstance()
 const 
   64  return new QgsDensifyGeometriesByIntervalAlgorithm;
 
   67QList<int> QgsDensifyGeometriesByIntervalAlgorithm::inputLayerTypes()
 const 
   72void QgsDensifyGeometriesByIntervalAlgorithm::initParameters( 
const QVariantMap &configuration )
 
   74  Q_UNUSED( configuration )
 
   75  auto interval = std::make_unique<QgsProcessingParameterDistance>( QStringLiteral( 
"INTERVAL" ), QObject::tr( 
"Interval between vertices to add" ), 1, QStringLiteral( 
"INPUT" ), 
false, 0, 10000000 );
 
   76  interval->setIsDynamic( 
true );
 
   78  interval->setDynamicLayerParameterName( QStringLiteral( 
"INPUT" ) );
 
   79  addParameter( interval.release() );
 
   82QString QgsDensifyGeometriesByIntervalAlgorithm::outputName()
 const 
   84  return QObject::tr( 
"Densified" );
 
   93  double interval = mInterval;
 
   94  if ( mDynamicInterval )
 
   95    interval = mIntervalProperty.valueAsDouble( context.
expressionContext(), interval );
 
  106  mInterval = parameterAsDouble( parameters, QStringLiteral( 
"INTERVAL" ), context );
 
  109  if ( mDynamicInterval )
 
  110    mIntervalProperty = parameters.value( QStringLiteral( 
"INTERVAL" ) ).value<
QgsProperty>();
 
@ VectorPolygon
Vector polygon layers.
 
@ VectorLine
Vector line layers.
 
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...
 
Definition for a property.
 
@ DoublePositive
Positive double value (including 0)
 
A store for object properties.
 
QList< QgsFeature > QgsFeatureList