22void QgsSubdivideAlgorithm::initParameters( 
const QVariantMap & )
 
   25  nodes->setIsDynamic( 
true );
 
   27  nodes->setDynamicLayerParameterName( QStringLiteral( 
"INPUT" ) );
 
   29  addParameter( nodes.release() );
 
   32QString QgsSubdivideAlgorithm::name()
 const 
   34  return QStringLiteral( 
"subdivide" );
 
   37QString QgsSubdivideAlgorithm::displayName()
 const 
   39  return QObject::tr( 
"Subdivide" );
 
   42QStringList QgsSubdivideAlgorithm::tags()
 const 
   44  return QObject::tr( 
"subdivide,segmentize,split,tessellate" ).split( 
',' );
 
   47QString QgsSubdivideAlgorithm::group()
 const 
   49  return QObject::tr( 
"Vector geometry" );
 
   52QString QgsSubdivideAlgorithm::groupId()
 const 
   54  return QStringLiteral( 
"vectorgeometry" );
 
   57QString QgsSubdivideAlgorithm::shortHelpString()
 const 
   59  return QObject::tr( 
"This algorithm subdivides the geometry. The returned geometry will be a collection containing subdivided parts " 
   60                      "from the original geometry, where no part has more than the specified maximum number of nodes.\n\n" 
   61                      "This is useful for dividing a complex geometry into less complex parts, which are better able to be spatially " 
   62                      "indexed and faster to perform further operations such as intersects on. The returned geometry parts may " 
   63                      "not be valid and may contain self-intersections.\n\n" 
   64                      "Curved geometries will be segmentized before subdivision." );
 
   67QString QgsSubdivideAlgorithm::shortDescription()
 const 
   69  return QObject::tr( 
"Subdivides the geometry into parts that have less than a specified maximum number of nodes." );
 
   72QgsSubdivideAlgorithm *QgsSubdivideAlgorithm::createInstance()
 const 
   74  return new QgsSubdivideAlgorithm();
 
   77QString QgsSubdivideAlgorithm::outputName()
 const 
   79  return QObject::tr( 
"Subdivided" );
 
   92    int maxNodes = mMaxNodes;
 
   93    if ( mDynamicMaxNodes )
 
   94      maxNodes = mMaxNodesProperty.valueAsDouble( context.
expressionContext(), maxNodes );
 
   99      feedback->
reportError( QObject::tr( 
"Error calculating subdivision for feature %1" ).arg( feature.
id() ) );
 
  107  mMaxNodes = parameterAsInt( parameters, QStringLiteral( 
"MAX_NODES" ), context );
 
  109  if ( mDynamicMaxNodes )
 
  110    mMaxNodesProperty = parameters.value( QStringLiteral( 
"MAX_NODES" ) ).value<
QgsProperty>();
 
WkbType
The WKB type describes the number of dimensions a geometry has.
 
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 subdivide(int maxNodes=256, const QgsGeometryParameters ¶meters=QgsGeometryParameters()) const
Subdivides the geometry.
 
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.
 
virtual void reportError(const QString &error, bool fatalError=false)
Reports that the algorithm encountered an error while executing.
 
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.
 
@ Integer
Integer value (including negative values)
 
A store for object properties.
 
static Qgis::WkbType multiType(Qgis::WkbType type)
Returns the multi type for a WKB type.
 
QList< QgsFeature > QgsFeatureList