File tree Expand file tree Collapse file tree 4 files changed +16
-2
lines changed Expand file tree Collapse file tree 4 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -795,6 +795,12 @@ class QgsProcessingFeatureBasedAlgorithm : QgsProcessingAlgorithm
795
795
:rtype: QgsProcessing.SourceType
796
796
%End
797
797
798
+ virtual QgsProcessingFeatureSource::Flag sourceFlags() const;
799
+ %Docstring
800
+ Returns the processing feature source flags to be used in the algorithm.
801
+ :rtype: QgsProcessingFeatureSource.Flag
802
+ %End
803
+
798
804
virtual QgsWkbTypes::Type outputWkbType( QgsWkbTypes::Type inputWkbType ) const;
799
805
%Docstring
800
806
Maps the input WKB geometry type (``inputWkbType``) to the corresponding
Original file line number Diff line number Diff line change 24
24
#include " qgis.h"
25
25
#include " qgsprocessingalgorithm.h"
26
26
#include " qgsprocessingprovider.h"
27
+ #include " qgsprocessingutils.h"
27
28
#include " qgsmaptopixelgeometrysimplifier.h"
28
29
29
30
// /@cond PRIVATE
@@ -598,6 +599,7 @@ class QgsFixGeometriesAlgorithm : public QgsProcessingFeatureBasedAlgorithm
598
599
QgsFixGeometriesAlgorithm *createInstance () const override SIP_FACTORY;
599
600
600
601
protected:
602
+ QgsProcessingFeatureSource::Flag sourceFlags () const override { return QgsProcessingFeatureSource::FlagSkipGeometryValidityChecks; }
601
603
QString outputName () const override { return QObject::tr ( " Fixed geometries" ); }
602
604
QgsWkbTypes::Type outputWkbType ( QgsWkbTypes::Type type ) const override { return QgsWkbTypes::multiType ( type ); }
603
605
QgsFeature processFeature ( const QgsFeature &feature, QgsProcessingFeedback *feedback ) override ;
Original file line number Diff line number Diff line change @@ -654,7 +654,7 @@ QVariantMap QgsProcessingFeatureBasedAlgorithm::processAlgorithm( const QVariant
654
654
long count = mSource ->featureCount ();
655
655
656
656
QgsFeature f;
657
- QgsFeatureIterator it = mSource ->getFeatures ();
657
+ QgsFeatureIterator it = mSource ->getFeatures ( QgsFeatureRequest (), sourceFlags () );
658
658
659
659
double step = count > 0 ? 100.0 / count : 1 ;
660
660
int current = 0 ;
Original file line number Diff line number Diff line change 23
23
#include " qgsprocessingparameters.h"
24
24
#include " qgsprocessingoutputs.h"
25
25
#include " qgsprocessingcontext.h"
26
+ #include " qgsprocessingutils.h"
26
27
#include " qgsfeaturesource.h"
27
28
#include < QString>
28
29
#include < QVariant>
@@ -782,6 +783,11 @@ class CORE_EXPORT QgsProcessingFeatureBasedAlgorithm : public QgsProcessingAlgor
782
783
*/
783
784
virtual QgsProcessing::SourceType outputLayerType () const { return QgsProcessing::TypeVectorAnyGeometry; }
784
785
786
+ /* *
787
+ * Returns the processing feature source flags to be used in the algorithm.
788
+ */
789
+ virtual QgsProcessingFeatureSource::Flag sourceFlags () const { return static_cast <QgsProcessingFeatureSource::Flag>( 0 ); }
790
+
785
791
/* *
786
792
* Maps the input WKB geometry type (\a inputWkbType) to the corresponding
787
793
* output WKB type generated by the algorithm. The default behavior is that the algorithm maintains
@@ -853,7 +859,7 @@ class CORE_EXPORT QgsProcessingFeatureBasedAlgorithm : public QgsProcessingAlgor
853
859
854
860
private:
855
861
856
- std::unique_ptr< QgsFeatureSource > mSource ;
862
+ std::unique_ptr< QgsProcessingFeatureSource > mSource ;
857
863
858
864
};
859
865
You can’t perform that action at this time.
0 commit comments