22 void QgsSubdivideAlgorithm::initParameters(
const QVariantMap & )
25 256,
false, 8, 100000 ) );
28 QString QgsSubdivideAlgorithm::name()
const 30 return QStringLiteral(
"subdivide" );
33 QString QgsSubdivideAlgorithm::displayName()
const 35 return QObject::tr(
"Subdivide" );
38 QStringList QgsSubdivideAlgorithm::tags()
const 40 return QObject::tr(
"subdivide,segmentize,split,tessellate" ).split(
',' );
43 QString QgsSubdivideAlgorithm::group()
const 45 return QObject::tr(
"Vector geometry" );
48 QString QgsSubdivideAlgorithm::groupId()
const 50 return QStringLiteral(
"vectorgeometry" );
53 QString QgsSubdivideAlgorithm::shortHelpString()
const 55 return QObject::tr(
"Subdivides the geometry. The returned geometry will be a collection containing subdivided parts " 56 "from the original geometry, where no part has more then the specified maximum number of nodes.\n\n" 57 "This is useful for dividing a complex geometry into less complex parts, which are better able to be spatially " 58 "indexed and faster to perform further operations such as intersects on. The returned geometry parts may " 59 "not be valid and may contain self-intersections.\n\n" 60 "Curved geometries will be segmentized before subdivision." );
63 QgsSubdivideAlgorithm *QgsSubdivideAlgorithm::createInstance()
const 65 return new QgsSubdivideAlgorithm();
68 QString QgsSubdivideAlgorithm::outputName()
const 70 return QObject::tr(
"Subdivided" );
86 feedback->
reportError( QObject::tr(
"Error calculating subdivision for feature %1" ).arg( feature.
id() ) );
94 mMaxNodes = parameterAsInt( parameters, QStringLiteral(
"MAX_NODES" ), context );
static Type multiType(Type type)
Returns the multi type for a WKB type.
Base class for providing feedback from a processing algorithm.
QList< QgsFeature > QgsFeatureList
QgsGeometry subdivide(int maxNodes=256) const
Subdivides the geometry.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
bool hasGeometry() const
Returns true if the feature has an associated geometry.
Type
The WKB type describes the number of dimensions a geometry has.
QgsGeometry geometry() const
Returns the geometry associated with this feature.
A numeric parameter for processing algorithms.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
Contains information about the context in which a processing algorithm is executed.
virtual void reportError(const QString &error, bool fatalError=false)
Reports that the algorithm encountered an error while executing.