Skip to content
Permalink
Browse files

Update to QgsProcessingFeatureSource::hasFeatures

  • Loading branch information
m-kuhn committed Jun 26, 2018
1 parent 1b15e68 commit ae6bffde241ec7908e3645171533a8773466f1b2
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/core/processing/qgsprocessingutils.cpp
@@ -723,10 +723,14 @@ QgsFeatureIterator QgsProcessingFeatureSource::getFeatures( const QgsFeatureRequ

QgsFeatureSource::FeatureAvailability QgsProcessingFeatureSource::hasFeatures() const
{
if ( !mTransformErrorCallback && !mInvalidGeometryCallback && mInvalidGeometryCheck == QgsFeatureRequest::GeometryNoCheck )
return mSource->hasFeatures();
FeatureAvailability sourceAvailability = mSource->hasFeatures();
if ( sourceAvailability == NoFeaturesAvailable )
return NoFeaturesAvailable; // never going to be features if underlying source has no features
else if ( mInvalidGeometryCheck == QgsFeatureRequest::GeometryNoCheck )
return sourceAvailability;
else
return QgsFeatureSource::FeaturesMaybeAvailable;
// we don't know... source has features, but these may be filtered out by invalid geometry check
return FeaturesMaybeAvailable;
}

QgsFeatureIterator QgsProcessingFeatureSource::getFeatures( const QgsFeatureRequest &request ) const

0 comments on commit ae6bffd

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