Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] Collect features algorithm doesn't care about geometry v…
…alidity
  • Loading branch information
nyalldawson committed Jul 8, 2020
1 parent d9936de commit e8c080a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/analysis/processing/qgsalgorithmdissolve.cpp
Expand Up @@ -24,9 +24,9 @@
// //


QVariantMap QgsCollectorAlgorithm::processCollection( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback, QVariantMap QgsCollectorAlgorithm::processCollection( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback,
const std::function<QgsGeometry( const QVector< QgsGeometry >& )> &collector, int maxQueueLength ) const std::function<QgsGeometry( const QVector< QgsGeometry >& )> &collector, int maxQueueLength, QgsProcessingFeatureSource::Flags sourceFlags )
{ {
std::unique_ptr< QgsFeatureSource > source( parameterAsSource( parameters, QStringLiteral( "INPUT" ), context ) ); std::unique_ptr< QgsProcessingFeatureSource > source( parameterAsSource( parameters, QStringLiteral( "INPUT" ), context ) );
if ( !source ) if ( !source )
throw QgsProcessingException( invalidSourceError( parameters, QStringLiteral( "INPUT" ) ) ); throw QgsProcessingException( invalidSourceError( parameters, QStringLiteral( "INPUT" ) ) );


Expand All @@ -41,7 +41,7 @@ QVariantMap QgsCollectorAlgorithm::processCollection( const QVariantMap &paramet
long count = source->featureCount(); long count = source->featureCount();


QgsFeature f; QgsFeature f;
QgsFeatureIterator it = source->getFeatures(); QgsFeatureIterator it = source->getFeatures( QgsFeatureRequest(), sourceFlags );


double step = count > 0 ? 100.0 / count : 1; double step = count > 0 ? 100.0 / count : 1;
int current = 0; int current = 0;
Expand Down Expand Up @@ -281,7 +281,7 @@ QVariantMap QgsCollectAlgorithm::processAlgorithm( const QVariantMap &parameters
return processCollection( parameters, context, feedback, []( const QVector< QgsGeometry > &parts )->QgsGeometry return processCollection( parameters, context, feedback, []( const QVector< QgsGeometry > &parts )->QgsGeometry
{ {
return QgsGeometry::collectGeometry( parts ); return QgsGeometry::collectGeometry( parts );
} ); }, 0, QgsProcessingFeatureSource::FlagSkipGeometryValidityChecks );
} }




Expand Down
2 changes: 1 addition & 1 deletion src/analysis/processing/qgsalgorithmdissolve.h
Expand Up @@ -34,7 +34,7 @@ class QgsCollectorAlgorithm : public QgsProcessingAlgorithm
protected: protected:


QVariantMap processCollection( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback, QVariantMap processCollection( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback,
const std::function<QgsGeometry( const QVector<QgsGeometry>& )> &collector, int maxQueueLength = 0 ); const std::function<QgsGeometry( const QVector<QgsGeometry>& )> &collector, int maxQueueLength = 0, QgsProcessingFeatureSource::Flags sourceFlags = nullptr );
}; };


/** /**
Expand Down

0 comments on commit e8c080a

Please sign in to comment.