22 QString QgsMergeLinesAlgorithm::name()
const 24 return QStringLiteral(
"mergelines" );
27 QString QgsMergeLinesAlgorithm::displayName()
const 29 return QObject::tr(
"Merge lines" );
32 QStringList QgsMergeLinesAlgorithm::tags()
const 34 return QObject::tr(
"line,merge,join,parts" ).split(
',' );
37 QString QgsMergeLinesAlgorithm::group()
const 39 return QObject::tr(
"Vector geometry" );
42 QString QgsMergeLinesAlgorithm::groupId()
const 44 return QStringLiteral(
"vectorgeometry" );
47 QString QgsMergeLinesAlgorithm::outputName()
const 49 return QObject::tr(
"Merged" );
62 QString QgsMergeLinesAlgorithm::shortHelpString()
const 64 return QObject::tr(
"This algorithm joins all connected parts of MultiLineString geometries into single LineString geometries.\n\n" 65 "If any parts of the input MultiLineString geometries are not connected, the resultant " 66 "geometry will be a MultiLineString containing any lines which could be merged and any non-connected line parts." );
69 QList<int> QgsMergeLinesAlgorithm::inputLayerTypes()
const 74 QgsMergeLinesAlgorithm *QgsMergeLinesAlgorithm::createInstance()
const 76 return new QgsMergeLinesAlgorithm();
86 if ( outputGeometry.
isNull() )
87 feedback->
reportError( QObject::tr(
"Error merging lines for feature %1" ).arg( feature.
id() ) );
Base class for providing feedback from a processing algorithm.
bool isNull() const
Returns true if the geometry is null (ie, contains no underlying geometry accessible via geometry() )...
QList< QgsFeature > QgsFeatureList
A geometry is the spatial representation of a feature.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Type
The WKB type describes the number of dimensions a geometry has.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
bool hasGeometry() const
Returns true if the feature has an associated geometry.
SourceType
Data source types enum.
Contains information about the context in which a processing algorithm is executed.
QgsGeometry mergeLines() const
Merges any connected lines in a LineString/MultiLineString geometry and converts them to single line ...
virtual void reportError(const QString &error, bool fatalError=false)
Reports that the algorithm encountered an error while executing.