Skip to content

Commit

Permalink
Update to QgsProcessingFeatureSource::hasFeatures
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jun 26, 2018
1 parent 1b15e68 commit ae6bffd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/core/processing/qgsprocessingutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ae6bffd

Please sign in to comment.