22 QString QgsFixGeometriesAlgorithm::name()
const 24 return QStringLiteral(
"fixgeometries" );
27 QString QgsFixGeometriesAlgorithm::displayName()
const 29 return QObject::tr(
"Fix geometries" );
32 QStringList QgsFixGeometriesAlgorithm::tags()
const 34 return QObject::tr(
"repair,invalid,geometry,make,valid" ).split(
',' );
37 QString QgsFixGeometriesAlgorithm::group()
const 39 return QObject::tr(
"Vector geometry" );
42 QString QgsFixGeometriesAlgorithm::groupId()
const 44 return QStringLiteral(
"vectorgeometry" );
52 QString QgsFixGeometriesAlgorithm::outputName()
const 54 return QObject::tr(
"Fixed geometries" );
62 QString QgsFixGeometriesAlgorithm::shortHelpString()
const 64 return QObject::tr(
"This algorithm attempts to create a valid representation of a given invalid geometry without " 65 "losing any of the input vertices. Already-valid geometries are returned without further intervention. " 66 "Always outputs multi-geometry layer.\n\n" 67 "NOTE: M values will be dropped from the output." );
70 QgsFixGeometriesAlgorithm *QgsFixGeometriesAlgorithm::createInstance()
const 72 return new QgsFixGeometriesAlgorithm();
83 if ( !outputGeometry )
85 feedback->
pushInfo( QObject::tr(
"makeValid failed for feature %1 " ).arg( feature.
id() ) );
95 QVector< QgsGeometry > matchingParts;
101 if ( !matchingParts.empty() )
static Type multiType(Type type)
Returns the multi type for a WKB type.
Base class for providing feedback from a processing algorithm.
Invalid geometry checks should always be skipped. This flag can be useful for algorithms which always...
QList< QgsFeature > QgsFeatureList
QgsWkbTypes::Type wkbType() const
Returns type of the geometry as a WKB type (point / linestring / polygon etc.)
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...
bool hasGeometry() const
Returns true if the feature has an associated geometry.
QVector< QgsGeometry > asGeometryCollection() const
Returns contents of the geometry as a list of geometries.
Type
The WKB type describes the number of dimensions a geometry has.
static GeometryType geometryType(Type type)
Returns the geometry type for a WKB type, e.g., both MultiPolygon and CurvePolygon would have a Polyg...
QgsGeometry geometry() const
Returns the geometry associated with this feature.
QgsWkbTypes::GeometryType type() const
Returns type of the geometry as a QgsWkbTypes::GeometryType.
Flag
Flags controlling how QgsProcessingFeatureSource fetches features.
void clearGeometry()
Removes any geometry associated with the feature.
bool convertToMultiType()
Converts single type geometry into multitype geometry e.g.
QgsGeometry makeValid() const
Attempts to make an invalid geometry valid without losing vertices.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
static QString displayString(Type type)
Returns a display string type for a WKB type, e.g., the geometry name used in WKT geometry representa...
static Type flatType(Type type)
Returns the flat type for a WKB type.
Contains information about the context in which a processing algorithm is executed.
static QgsGeometry collectGeometry(const QVector< QgsGeometry > &geometries)
Creates a new multipart geometry from a list of QgsGeometry objects.
virtual void pushInfo(const QString &info)
Pushes a general informational message from the algorithm.