Skip to content
Permalink
Browse files

Native processing algs use FastInsert were possible

We want maximum possible speed here
  • Loading branch information
nyalldawson committed Jun 15, 2017
1 parent 0e9d94b commit 72ef452fbc637fc9069bbf41a68696186d2c07e7
Showing with 7 additions and 7 deletions.
  1. 0 src/app/qgisapp.cpp
  2. +7 −7 src/core/processing/qgsnativealgorithms.cpp
0 src/app/qgisapp.cpp 100644 → 100755
No changes.
@@ -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++;
@@ -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++;
@@ -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;
@@ -321,7 +321,7 @@ QVariantMap QgsDissolveAlgorithm::processAlgorithm( const QVariantMap &parameter
}

outputFeature.setGeometry( QgsGeometry::unaryUnion( geomQueue ) );
sink->addFeature( outputFeature );
sink->addFeature( outputFeature, QgsFeatureSink::FastInsert );
}
else
{
@@ -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++;
@@ -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 )
@@ -583,7 +583,7 @@ QVariantMap QgsTransformAlgorithm::processAlgorithm( const QVariantMap &paramete
break;
}

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

0 comments on commit 72ef452

Please sign in to comment.
You can’t perform that action at this time.