Skip to content

Commit

Permalink
Native processing algs use FastInsert were possible
Browse files Browse the repository at this point in the history
We want maximum possible speed here
  • Loading branch information
nyalldawson committed Jun 15, 2017
1 parent 0e9d94b commit 72ef452
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Empty file modified src/app/qgisapp.cpp 100644 → 100755
Empty file.
14 changes: 7 additions & 7 deletions src/core/processing/qgsnativealgorithms.cpp 100644 → 100755
Expand Up @@ -116,7 +116,7 @@ QVariantMap QgsCentroidAlgorithm::processAlgorithm( const QVariantMap &parameter
QgsMessageLog::logMessage( QObject::tr( "Error calculating centroid for feature %1" ).arg( f.id() ), QObject::tr( "Processing" ), QgsMessageLog::WARNING );
}
}
sink->addFeature( out );
sink->addFeature( out, QgsFeatureSink::FastInsert );

feedback->setProgress( current * step );
current++;
Expand Down Expand Up @@ -219,7 +219,7 @@ QVariantMap QgsBufferAlgorithm::processAlgorithm( const QVariantMap &parameters,
}

if ( !dissolve )
sink->addFeature( out );
sink->addFeature( out, QgsFeatureSink::FastInsert );

feedback->setProgress( current * step );
current++;
Expand All @@ -231,7 +231,7 @@ QVariantMap QgsBufferAlgorithm::processAlgorithm( const QVariantMap &parameters,
QgsFeature f;
f.setGeometry( finalGeometry );
f.setAttributes( dissolveAttrs );
sink->addFeature( f );
sink->addFeature( f, QgsFeatureSink::FastInsert );
}

QVariantMap outputs;
Expand Down Expand Up @@ -321,7 +321,7 @@ QVariantMap QgsDissolveAlgorithm::processAlgorithm( const QVariantMap &parameter
}

outputFeature.setGeometry( QgsGeometry::unaryUnion( geomQueue ) );
sink->addFeature( outputFeature );
sink->addFeature( outputFeature, QgsFeatureSink::FastInsert );
}
else
{
Expand Down Expand Up @@ -372,7 +372,7 @@ QVariantMap QgsDissolveAlgorithm::processAlgorithm( const QVariantMap &parameter
QgsFeature outputFeature;
outputFeature.setGeometry( QgsGeometry::unaryUnion( geomIt.value() ) );
outputFeature.setAttributes( attributeHash.value( geomIt.key() ) );
sink->addFeature( outputFeature );
sink->addFeature( outputFeature, QgsFeatureSink::FastInsert );

feedback->setProgress( current * 100.0 / numberFeatures );
current++;
Expand Down Expand Up @@ -515,7 +515,7 @@ QVariantMap QgsClipAlgorithm::processAlgorithm( const QVariantMap &parameters, Q
QgsFeature outputFeature;
outputFeature.setGeometry( newGeometry );
outputFeature.setAttributes( inputFeature.attributes() );
sink->addFeature( outputFeature );
sink->addFeature( outputFeature, QgsFeatureSink::FastInsert );


if ( singleClipFeature )
Expand Down Expand Up @@ -583,7 +583,7 @@ QVariantMap QgsTransformAlgorithm::processAlgorithm( const QVariantMap &paramete
break;
}

sink->addFeature( f );
sink->addFeature( f, QgsFeatureSink::FastInsert );
feedback->setProgress( current * step );
current++;
}
Expand Down

0 comments on commit 72ef452

Please sign in to comment.