Skip to content

Commit d72e434

Browse files
committedOct 31, 2018
Regenerate fids for "multipart to singlepart algorithm"
1 parent 10fb944 commit d72e434

File tree

5 files changed

+27
-1
lines changed

5 files changed

+27
-1
lines changed
 

‎python/core/auto_generated/processing/qgsprocessingalgorithm.sip.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,13 @@ this is possible to determine in advance.
922922
virtual QgsProcessingFeatureSource::Flag sourceFlags() const;
923923
%Docstring
924924
Returns the processing feature source flags to be used in the algorithm.
925+
%End
926+
927+
virtual QgsProcessingFeatureSink::SinkFlags sinkFlags() const;
928+
%Docstring
929+
Returns the feature sink flags to be used for the output.
930+
931+
.. versionadded:: 3.4.1
925932
%End
926933

927934
virtual QgsWkbTypes::Type outputWkbType( QgsWkbTypes::Type inputWkbType ) const;

‎src/analysis/processing/qgsalgorithmmultiparttosinglepart.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ QgsProcessingFeatureSource::Flag QgsMultipartToSinglepartAlgorithm::sourceFlags(
7474
return QgsProcessingFeatureSource::FlagSkipGeometryValidityChecks;
7575
}
7676

77+
QgsFeatureSink::SinkFlags QgsMultipartToSinglepartAlgorithm::sinkFlags() const
78+
{
79+
return QgsFeatureSink::RegeneratePrimaryKey;
80+
}
81+
7782
QgsFeatureList QgsMultipartToSinglepartAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback * )
7883
{
7984
if ( !feature.hasGeometry() )

‎src/analysis/processing/qgsalgorithmmultiparttosinglepart.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class QgsMultipartToSinglepartAlgorithm : public QgsProcessingFeatureBasedAlgori
4949
protected:
5050

5151
QgsProcessingFeatureSource::Flag sourceFlags() const override;
52+
QgsFeatureSink::SinkFlags sinkFlags() const override;
5253
QgsFeatureList processFeature( const QgsFeature &feature,
5354
QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
5455

‎src/core/processing/qgsprocessingalgorithm.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,11 @@ QgsProcessingFeatureSource::Flag QgsProcessingFeatureBasedAlgorithm::sourceFlags
824824
return static_cast<QgsProcessingFeatureSource::Flag>( 0 );
825825
}
826826

827+
QgsFeatureSink::SinkFlags QgsProcessingFeatureBasedAlgorithm::sinkFlags() const
828+
{
829+
return nullptr;
830+
}
831+
827832
QgsWkbTypes::Type QgsProcessingFeatureBasedAlgorithm::outputWkbType( QgsWkbTypes::Type inputWkbType ) const
828833
{
829834
return inputWkbType;
@@ -858,7 +863,8 @@ QVariantMap QgsProcessingFeatureBasedAlgorithm::processAlgorithm( const QVariant
858863
std::unique_ptr< QgsFeatureSink > sink( parameterAsSink( parameters, QStringLiteral( "OUTPUT" ), context, dest,
859864
outputFields( mSource->fields() ),
860865
outputWkbType( mSource->wkbType() ),
861-
outputCrs( mSource->sourceCrs() ) ) );
866+
outputCrs( mSource->sourceCrs() ),
867+
sinkFlags() ) );
862868
if ( !sink )
863869
throw QgsProcessingException( invalidSinkError( parameters, QStringLiteral( "OUTPUT" ) ) );
864870

‎src/core/processing/qgsprocessingalgorithm.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,13 @@ class CORE_EXPORT QgsProcessingFeatureBasedAlgorithm : public QgsProcessingAlgor
929929
*/
930930
virtual QgsProcessingFeatureSource::Flag sourceFlags() const;
931931

932+
/**
933+
* Returns the feature sink flags to be used for the output.
934+
*
935+
* \since QGIS 3.4.1
936+
*/
937+
virtual QgsProcessingFeatureSink::SinkFlags sinkFlags() const;
938+
932939
/**
933940
* Maps the input WKB geometry type (\a inputWkbType) to the corresponding
934941
* output WKB type generated by the algorithm. The default behavior is that the algorithm maintains

0 commit comments

Comments
 (0)
Please sign in to comment.