35 return QList<QgsRasterLayer *>();
37 QList<QgsRasterLayer *> layers;
40 if ( canUseLayer( l ) )
48 return QString::localeAwareCompare( a->
name(), b->name() ) < 0;
57 return QList<QgsVectorLayer *>();
59 QList<QgsVectorLayer *> layers;
62 if ( canUseLayer( l, geometryTypes ) )
70 return QString::localeAwareCompare( a->
name(), b->name() ) < 0;
79 return QList<QgsMapLayer *>();
81 QList<QgsMapLayer *> layers;
91 return QString::localeAwareCompare( a->
name(), b->name() ) < 0;
99 if ( !store ||
string.isEmpty() )
102 QList< QgsMapLayer * > layers = store->
mapLayers().values();
104 layers.erase( std::remove_if( layers.begin(), layers.end(), [](
QgsMapLayer * layer )
106 switch ( layer->type() )
109 return !canUseLayer( qobject_cast< QgsVectorLayer * >( layer ) );
111 return !canUseLayer( qobject_cast< QgsRasterLayer * >( layer ) );
120 if ( l->
id() == string )
125 if ( l->
name() == string )
137 class ProjectionSettingRestorer
141 ProjectionSettingRestorer()
144 previousSetting = settings.
value( QStringLiteral(
"/Projections/defaultBehavior" ) ).toString();
145 settings.
setValue( QStringLiteral(
"/Projections/defaultBehavior" ), QStringLiteral(
"useProject" ) );
148 ~ProjectionSettingRestorer()
151 settings.
setValue( QStringLiteral(
"/Projections/defaultBehavior" ), previousSetting );
154 QString previousSetting;
158 QgsMapLayer *QgsProcessingUtils::loadMapLayerFromString(
const QString &
string )
160 QStringList components =
string.split(
'|' );
161 if ( components.isEmpty() )
165 if ( QFileInfo::exists(
string ) )
166 fi = QFileInfo(
string );
167 else if ( QFileInfo::exists( components.at( 0 ) ) )
168 fi = QFileInfo( components.at( 0 ) );
173 ProjectionSettingRestorer restorer;
176 QString name = fi.baseName();
181 std::unique_ptr< QgsVectorLayer > layer(
new QgsVectorLayer(
string, name, QStringLiteral(
"ogr" ), options ) );
182 if ( layer->isValid() )
184 return layer.release();
188 std::unique_ptr< QgsRasterLayer > rasterLayer(
new QgsRasterLayer(
string, name, QStringLiteral(
"gdal" ), rasterOptions ) );
189 if ( rasterLayer->isValid() )
191 return rasterLayer.release();
198 if (
string.isEmpty() )
214 if ( !allowLoadingNewLayers )
217 layer = loadMapLayerFromString(
string );
231 QVariant val = value;
232 bool selectedFeaturesOnly =
false;
241 if (
QgsVectorLayer *layer = qobject_cast< QgsVectorLayer * >( qvariant_cast<QObject *>( val ) ) )
251 else if ( !val.isValid() || val.toString().isEmpty() )
254 if (
QgsVectorLayer *layer = qobject_cast< QgsVectorLayer * >( qvariant_cast<QObject *>( fallbackValue ) ) )
259 layerRef = fallbackValue.toString();
263 layerRef = val.toString();
266 if ( layerRef.isEmpty() )
273 if ( selectedFeaturesOnly )
283 bool QgsProcessingUtils::canUseLayer(
const QgsRasterLayer *layer )
286 return layer && layer->
providerType() == QStringLiteral(
"gdal" );
289 bool QgsProcessingUtils::canUseLayer(
const QgsVectorLayer *layer,
const QList<QgsWkbTypes::GeometryType> &geometryTypes )
292 ( geometryTypes.isEmpty() || geometryTypes.contains( layer->
geometryType() ) );
297 QString normalized = source;
298 normalized.replace(
'\\',
'/' );
299 return normalized.trimmed();
305 s.replace(
'"', QStringLiteral(
"\\\"" ) );
306 s.replace(
'\'', QStringLiteral(
"\\\'" ) );
307 s = s.prepend(
'\'' ).append(
'\'' );
311 void QgsProcessingUtils::parseDestinationString( QString &destination, QString &providerKey, QString &uri, QString &layerName, QString &format, QMap<QString, QVariant> &options,
bool &useWriter )
313 QRegularExpression splitRx( QStringLiteral(
"^(.{3,}?):(.*)$" ) );
314 QRegularExpressionMatch match = splitRx.match( destination );
315 if ( match.hasMatch() )
317 providerKey = match.captured( 1 );
318 if ( providerKey == QStringLiteral(
"postgis" ) )
320 providerKey = QStringLiteral(
"postgres" );
322 uri = match.captured( 2 );
323 if ( providerKey == QLatin1String(
"ogr" ) )
328 if ( !dsUri.
table().isEmpty() )
330 layerName = dsUri.
table();
331 options.insert(
"layerName", layerName );
335 options.insert( QStringLiteral(
"update" ),
true );
342 providerKey = QStringLiteral(
"ogr" );
343 QRegularExpression splitRx( QStringLiteral(
"^(.*)\\.(.*?)$" ) );
344 QRegularExpressionMatch match = splitRx.match( destination );
346 if ( match.hasMatch() )
348 extension = match.captured( 2 );
352 if ( format.isEmpty() )
354 format = QStringLiteral(
"GPKG" );
355 destination = destination + QStringLiteral(
".gpkg" );
358 options.insert( QStringLiteral(
"driverName" ), format );
365 QVariantMap options = createOptions;
366 if ( !options.contains( QStringLiteral(
"fileEncoding" ) ) )
372 if ( destination.isEmpty() || destination.startsWith( QStringLiteral(
"memory:" ) ) )
375 if ( destination.startsWith( QStringLiteral(
"memory:" ) ) )
376 destination = destination.mid( 7 );
378 if ( destination.isEmpty() )
379 destination = QStringLiteral(
"output" );
383 if ( !layer || !layer->isValid() )
389 destination = layer->id();
392 std::unique_ptr< QgsProcessingFeatureSink > sink(
new QgsProcessingFeatureSink( layer->dataProvider(), destination, context ) );
395 return sink.release();
403 bool useWriter =
false;
404 parseDestinationString( destination, providerKey, uri, layerName, format, options, useWriter );
406 if ( useWriter && providerKey == QLatin1String(
"ogr" ) )
410 QString finalFileName;
411 std::unique_ptr< QgsVectorFileWriter > writer = qgis::make_unique< QgsVectorFileWriter >( destination, options.value( QStringLiteral(
"fileEncoding" ) ).toString(), fields, geometryType, crs, format,
QgsVectorFileWriter::defaultDatasetOptions( format ),
414 if ( writer->hasError() )
416 throw QgsProcessingException( QObject::tr(
"Could not create layer %1: %2" ).arg( destination, writer->errorMessage() ) );
418 destination = finalFileName;
424 std::unique_ptr< QgsVectorLayerExporter > exporter(
new QgsVectorLayerExporter( uri, providerKey, fields, geometryType, crs,
true, options ) );
425 if ( exporter->errorCode() )
427 throw QgsProcessingException( QObject::tr(
"Could not create layer %1: %2" ).arg( destination, exporter->errorMessage() ) );
431 if ( !layerName.isEmpty() )
432 uri += QStringLiteral(
"|layername=%1" ).arg( layerName );
433 std::unique_ptr< QgsVectorLayer > layer(
new QgsVectorLayer( uri, destination, providerKey ) );
435 destination = layer->id();
446 *sink =
createFeatureSink( destination, context, fields, geometryType, crs, options );
486 if ( !input.isValid() )
487 return QStringLiteral(
"memory:%1" ).arg(
id.toString() );
503 QString res = input.toString();
504 if ( res.startsWith( QStringLiteral(
"memory:" ) ) )
506 return res +
'_' +
id.toString();
512 int lastIndex = res.lastIndexOf(
'.' );
513 return res.left( lastIndex ) +
'_' +
id.toString() + res.mid( lastIndex );
520 static QString sFolder;
521 static QMutex sMutex;
523 if ( sFolder.isEmpty() )
525 QString subPath = QUuid::createUuid().toString().remove(
'-' ).remove(
'{' ).remove(
'}' );
526 sFolder = QDir::tempPath() + QStringLiteral(
"/processing_" ) + subPath;
527 if ( !QDir( sFolder ).exists() )
528 QDir().mkpath( sFolder );
536 QString subPath = QUuid::createUuid().toString().remove(
'-' ).remove(
'{' ).remove(
'}' );
538 if ( !QDir( path ).exists() )
541 tmpDir.mkdir( path );
548 auto getText = [map](
const QString & key )->QString
550 if ( map.contains( key ) )
551 return map.value( key ).toString();
555 QString s = QObject::tr(
"<html><body><h2>Algorithm description</h2>\n" );
556 s += QStringLiteral(
"<p>" ) + getText( QStringLiteral(
"ALG_DESC" ) ) + QStringLiteral(
"</p>\n" );
557 s += QObject::tr(
"<h2>Input parameters</h2>\n" );
561 s += QStringLiteral(
"<h3>" ) + def->
description() + QStringLiteral(
"</h3>\n" );
562 s += QStringLiteral(
"<p>" ) + getText( def->
name() ) + QStringLiteral(
"</p>\n" );
564 s += QObject::tr(
"<h2>Outputs</h2>\n" );
567 s += QStringLiteral(
"<h3>" ) + def->
description() + QStringLiteral(
"</h3>\n" );
568 s += QStringLiteral(
"<p>" ) + getText( def->
name() ) + QStringLiteral(
"</p>\n" );
570 s += QLatin1String(
"<br>" );
571 s += QObject::tr(
"<p align=\"right\">Algorithm author: %1</p>" ).arg( getText( QStringLiteral(
"ALG_CREATOR" ) ) );
572 s += QObject::tr(
"<p align=\"right\">Help author: %1</p>" ).arg( getText( QStringLiteral(
"ALG_HELP_CREATOR" ) ) );
573 s += QObject::tr(
"<p align=\"right\">Algorithm version: %1</p>" ).arg( getText( QStringLiteral(
"ALG_VERSION" ) ) );
574 s += QStringLiteral(
"</body></html>" );
580 bool requiresTranslation = selectedFeaturesOnly;
581 if ( !selectedFeaturesOnly )
583 QFileInfo fi( vl->
source() );
584 requiresTranslation = !compatibleFormats.contains( fi.suffix(), Qt::CaseInsensitive );
587 if ( requiresTranslation )
595 if ( selectedFeaturesOnly )
617 QSet< QString > usedNames;
620 usedNames.insert(
f.name().toLower() );
625 if ( usedNames.contains(
f.name().toLower() ) )
628 QString newName =
f.name() +
'_' + QString::number( idx );
629 while ( usedNames.contains( newName.toLower() ) )
632 newName =
f.name() +
'_' + QString::number( idx );
636 outFields.
append( newField );
637 usedNames.insert( newName.toLower() );
641 usedNames.insert(
f.name().toLower() );
655 : mSource( originalSource )
656 , mOwnsSource( ownsOriginalSource )
657 , mInvalidGeometryCheck( context.invalidGeometryCheck() )
658 , mInvalidGeometryCallback( context.invalidGeometryCallback() )
659 , mTransformErrorCallback( context.transformErrorCallback() )
752 return expressionContextScope;
761 , mContext( context )
762 , mSinkName( sinkName )
763 , mOwnsSink( ownsOriginalSink )
776 mContext.
feedback()->
reportError( QObject::tr(
"Feature could not be written to %1" ).arg( mSinkName ) );
784 mContext.
feedback()->
reportError( QObject::tr(
"%1 feature(s) could not be written to %2" ).arg( features.count() ).arg( mSinkName ) );
792 mContext.
feedback()->
reportError( QObject::tr(
"Features could not be written to %2" ).arg( mSinkName ) );
QgsProperty sink
Sink/layer definition.
static QgsMapLayer * mapLayerFromString(const QString &string, QgsProcessingContext &context, bool allowLoadingNewLayers=true)
Interprets a string as a map layer within the supplied context.
Wrapper for iterator of features from vector data provider or vector layer.
~QgsProcessingFeatureSource() override
virtual QgsRectangle sourceExtent() const
Returns the extent of all geometries from the source.
Use faster inserts, at the cost of updating the passed features to reflect changes made at the provid...
A rectangle specified with double values.
QgsWkbTypes::Type wkbType() const override
Returns the geometry type for features returned by this source.
Base class for all map layer types.
bool loadDefaultStyle
Set to true if the default layer style should be loaded.
QString table() const
Returns the table.
QString description() const
Returns the description for the output.
QgsFeatureRequest & setInvalidGeometryCallback(const std::function< void(const QgsFeature &)> &callback)
Sets a callback function to use when encountering an invalid geometry and invalidGeometryCheck() is s...
Base class for providing feedback from a processing algorithm.
QgsProcessingParameterDefinitions parameterDefinitions() const
Returns an ordered list of parameter definitions utilized by the algorithm.
Invalid geometry checks should always be skipped. This flag can be useful for algorithms which always...
virtual QgsFields fields() const =0
Returns the fields associated with features in the source.
Encapsulates settings relating to a feature sink or output raster layer for a processing algorithm...
A simple feature sink which proxies feature addition on to another feature sink.
static QgsRectangle combineLayerExtents(const QList< QgsMapLayer *> &layers, const QgsCoordinateReferenceSystem &crs=QgsCoordinateReferenceSystem())
Combines the extent of several map layers.
QgsFeatureRequest & setInvalidGeometryCheck(InvalidGeometryCheck check)
Sets invalid geometry checking behavior.
QgsProcessingFeatureSource(QgsFeatureSource *originalSource, const QgsProcessingContext &context, bool ownsOriginalSource=false)
Constructor for QgsProcessingFeatureSource, accepting an original feature source originalSource and p...
This class is a composition of two QSettings instances:
Setting options for loading vector layers.
QSet< QgsFeatureId > QgsFeatureIds
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
QList< QgsFeature > QgsFeatureList
QString name() const
Returns the name of the output.
QgsFeatureIds allFeatureIds() const override
Returns a list of all feature IDs for features present in the source.
virtual QgsWkbTypes::Type wkbType() const =0
Returns the geometry type for features returned by this source.
An interface for objects which accept features via addFeature(s) methods.
#define Q_NOWARN_DEPRECATED_PUSH
static QList< QgsRasterLayer *> compatibleRasterLayers(QgsProject *project, bool sort=true)
Returns a list of raster layers from a project which are compatible with the processing framework...
static QString stringToPythonLiteral(const QString &string)
Converts a string to a Python string literal.
QgsWkbTypes::GeometryType geometryType() const
Returns point, line or polygon.
QgsFeatureSource subclass which proxies methods to an underlying QgsFeatureSource, modifying results according to the settings in a QgsProcessingContext.
Container of fields for a vector layer.
void setName(const QString &name)
Set the field name.
bool addFeatures(QgsFeatureList &features, QgsFeatureSink::Flags flags=nullptr) override
Adds a list of features to the sink.
static QString driverForExtension(const QString &extension)
Returns the OGR driver name for a specified file extension.
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request, Flags flags) const
Returns an iterator for the features in the source, respecting the supplied feature flags...
A convenience class for writing vector files to disk.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
QVariant maximumValue(int fieldIndex) const override
Returns the maximum value for an attribute column or an invalid variant in case of error...
static QString convertToCompatibleFormat(const QgsVectorLayer *layer, bool selectedFeaturesOnly, const QString &baseName, const QStringList &compatibleFormats, const QString &preferredFormat, QgsProcessingContext &context, QgsProcessingFeedback *feedback)
Converts a source vector layer to a file path to a vector layer of compatible format.
QgsRectangle sourceExtent() const override
Returns the extent of all geometries from the source.
static QString normalizeLayerSource(const QString &source)
Normalizes a layer source string for safe comparison across different operating system environments...
Abstract base class for processing algorithms.
QgsMapLayerStore * layerStore()
Returns a pointer to the project's internal layer store.
QgsProject * project() const
Returns the project in which the algorithm is being executed.
bool selectedFeaturesOnly
True if only selected features in the source should be used by algorithms.
virtual QgsRectangle extent() const
Returns the extent of the layer.
static void createFeatureSinkPython(QgsFeatureSink **sink, QString &destination, QgsProcessingContext &context, const QgsFields &fields, QgsWkbTypes::Type geometryType, const QgsCoordinateReferenceSystem &crs, const QVariantMap &createOptions=QVariantMap())
Creates a feature sink ready for adding features.
bool addFeatures(QgsFeatureList &features, QgsFeatureSink::Flags flags=nullptr) override
Adds a list of features to the sink.
QSet< QVariant > uniqueValues(int fieldIndex, int limit=-1) const override
Returns the set of unique values contained within the specified fieldIndex from this source...
void setValue(const QString &key, const QVariant &value, const QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
QgsProcessingFeedback * feedback()
Returns the associated feedback object.
Type
The WKB type describes the number of dimensions a geometry has.
virtual QVariant minimumValue(int fieldIndex) const
Returns the minimum value for an attribute column or an invalid variant in case of error...
QgsFields fields() const override
Returns the fields associated with features in the source.
QString id() const
Returns the layer's unique ID, which is used to access this layer from QgsProject.
static QgsProperty fromValue(const QVariant &value, bool isActive=true)
Returns a new StaticProperty created from the specified value.
QgsMapLayerStore * temporaryLayerStore()
Returns a reference to the layer store used for storing temporary layers during algorithm execution...
QgsProperty source
Source definition.
static QgsFeatureSink * createFeatureSink(QString &destination, QgsProcessingContext &context, const QgsFields &fields, QgsWkbTypes::Type geometryType, const QgsCoordinateReferenceSystem &crs, const QVariantMap &createOptions=QVariantMap())
Creates a feature sink ready for adding features.
QgsFields fields() const override
Returns the list of fields of this layer.
static QStringList defaultLayerOptions(const QString &driverName)
Returns a list of the default layer options for a specified driver.
QVariant minimumValue(int fieldIndex) const override
Returns the minimum value for an attribute column or an invalid variant in case of error...
QgsFeatureIterator getSelectedFeatures(QgsFeatureRequest request=QgsFeatureRequest()) const
Get an iterator of the selected features.
static QgsFields combineFields(const QgsFields &fieldsA, const QgsFields &fieldsB)
Combines two field lists, avoiding duplicate field names (in a case-insensitive manner).
static QString stringToSafeFilename(const QString &string)
Converts a string to a safe filename, replacing characters which are not safe for filenames with an '...
bool loadDefaultStyle
Set to true if the default layer style should be loaded.
QgsCoordinateReferenceSystem sourceCrs() const override
Returns the coordinate reference system for features in the source.
QString providerType() const
[ data provider interface ] Which provider is being used for this Raster Layer?
QgsWkbTypes::Type wkbType() const override
Returns the WKBType or WKBUnknown in case of error.
This class wraps a request for features to a vector layer (or directly its vector data provider)...
Custom exception class for processing related exceptions.
static QList< QgsMapLayer *> compatibleLayers(QgsProject *project, bool sort=true)
Returns a list of map layers from a project which are compatible with the processing framework...
QgsCoordinateReferenceSystem crs() const
Returns the layer's spatial reference system.
bool append(const QgsField &field, FieldOrigin origin=OriginProvider, int originIndex=-1)
Append a field. The field must have unique name, otherwise it is rejected (returns false) ...
Reads and writes project states.
No invalid geometry checking.
bool addFeature(QgsFeature &feature, QgsFeatureSink::Flags flags=nullptr) override
Adds a single feature to the sink.
Encapsulate a field in an attribute table or data source.
Single scope for storing variables and functions for use within a QgsExpressionContext.
static QgsProcessingFeatureSource * variantToSource(const QVariant &value, QgsProcessingContext &context, const QVariant &fallbackValue=QVariant())
Converts a variant value to a new feature source.
A store for object properties.
virtual QSet< QVariant > uniqueValues(int fieldIndex, int limit=-1) const
Returns the set of unique values contained within the specified fieldIndex from this source...
QgsExpressionContext & expressionContext()
Returns the expression context.
QgsFeatureRequest & setTransformErrorCallback(const std::function< void(const QgsFeature &)> &callback)
Sets a callback function to use when encountering a transform error when iterating features and a des...
A convenience class for exporting vector layers to a destination data provider.
static QString tempFolder()
Returns a session specific processing temporary folder for use in processing algorithms.
virtual QgsCoordinateReferenceSystem sourceCrs() const =0
Returns the coordinate reference system for features in the source.
QString name() const
Returns the name of the parameter.
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) const override
Query the layer for features specified in request.
QgsExpressionContextScope * createExpressionContextScope() const
Returns an expression context scope suitable for this source.
Encapsulates settings relating to a feature source input to a processing algorithm.
QgsProcessingOutputDefinitions outputDefinitions() const
Returns an ordered list of output definitions utilized by the algorithm.
static QString generateTempFilename(const QString &basename)
Returns a temporary filename for a given file, putting it into a temporary folder (creating that fold...
void combineExtentWith(const QgsRectangle &rect)
Expand the rectangle so that covers both the original rectangle and the given rectangle.
Base class for the definition of processing outputs.
#define Q_NOWARN_DEPRECATED_POP
QgsProxyFeatureSink subclass which reports feature addition errors to a QgsProcessingContext.
static QString formatHelpMapAsHtml(const QVariantMap &map, const QgsProcessingAlgorithm *algorithm)
Returns a HTML formatted version of the help text encoded in a variant map for a specified algorithm...
QVector< T > layers() const
Returns a list of registered map layers with a specified layer type.
virtual QgsExpressionContextScope * createExpressionContextScope() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
QMap< QString, QgsMapLayer * > mapLayers() const
Returns a map of all layers by layer ID.
QgsFeatureSource subclass for the selected features from a QgsVectorLayer.
QgsMapLayer * addMapLayer(QgsMapLayer *layer, bool takeOwnership=true)
Add a layer to the store.
bool isCanceled() const
Tells whether the operation has been canceled already.
Abstract interface for generating an expression context scope.
QString defaultEncoding() const
Returns the default encoding to use for newly created files.
An interface for objects which provide features via a getFeatures method.
QString source() const
Returns the source for the layer.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), const Section section=NoSection) const
Returns the value for setting key.
static QVariant generateIteratingDestination(const QVariant &input, const QVariant &id, QgsProcessingContext &context)
Converts an input parameter value for use in source iterating mode, where one individual sink is crea...
QString sourceName() const override
Returns a friendly display name for the source.
static QStringList defaultDatasetOptions(const QString &driverName)
Returns a list of the default dataset options for a specified driver.
This class represents a coordinate reference system (CRS).
Base class for the definition of processing parameters.
A storage object for map layers, in which the layers are owned by the store and have their lifetime b...
static QList< QgsVectorLayer *> compatibleVectorLayers(QgsProject *project, const QList< QgsWkbTypes::GeometryType > &geometryTypes=QList< QgsWkbTypes::GeometryType >(), bool sort=true)
Returns a list of vector layers from a project which are compatible with the processing framework...
bool addFeature(QgsFeature &feature, QgsFeatureSink::Flags flags=nullptr) override
Adds a single feature to the sink.
Custom exception class for Coordinate Reference System related exceptions.
static QgsVectorLayer * createMemoryLayer(const QString &name, const QgsFields &fields, QgsWkbTypes::Type geometryType=QgsWkbTypes::NoGeometry, const QgsCoordinateReferenceSystem &crs=QgsCoordinateReferenceSystem())
Creates a new memory layer using the specified parameters.
virtual QVariant maximumValue(int fieldIndex) const
Returns the maximum value for an attribute column or an invalid variant in case of error...
bool nextFeature(QgsFeature &f)
QgsFeatureSink * destinationSink()
Returns the destination QgsFeatureSink which the proxy will forward features to.
~QgsProcessingFeatureSink()
virtual QString sourceName() const =0
Returns a friendly display name for the source.
long featureCount() const override
Returns the number of features contained in the source, or -1 if the feature count is unknown...
Class for storing the component parts of a PostgreSQL/RDBMS datasource URI.
Represents a vector layer which manages a vector based data sets.
virtual QgsFeatureIds allFeatureIds() const
Returns a list of all feature IDs for features present in the source.
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.
QString description() const
Returns the description for the parameter.
QString database() const
Returns the database.
Setting options for loading raster layers.
virtual QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) const =0
Returns an iterator for the features in the source.
virtual long featureCount() const =0
Returns the number of features contained in the source, or -1 if the feature count is unknown...
bool isValid() const
Returns whether this CRS is correctly initialized and usable.
QgsProcessingFeatureSink(QgsFeatureSink *originalSink, const QString &sinkName, QgsProcessingContext &context, bool ownsOriginalSink=false)
Constructor for QgsProcessingFeatureSink, accepting an original feature sink originalSink and process...