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() ) );
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.
A geometry is the spatial representation of a feature.
QgsGeometry mergeLines() const
Merges any connected lines in a LineString/MultiLineString geometry and converts them to single line ...
Contains information about the context in which a processing algorithm is executed.
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.
SourceType
Data source types enum.
@ TypeVectorLine
Vector line layers.
Type
The WKB type describes the number of dimensions a geometry has.
QList< QgsFeature > QgsFeatureList