mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-07 00:03:52 -05:00
Short-circuit for empty layers
This commit is contained in:
parent
de44380637
commit
7b5cd9bcd3
@ -83,9 +83,17 @@ void QgsLocationBasedAlgorithm::process( const QgsProcessingContext &context, Qg
|
|||||||
QgsProcessingFeedback *feedback,
|
QgsProcessingFeedback *feedback,
|
||||||
const QgsFeatureIds &skipTargetFeatureIds )
|
const QgsFeatureIds &skipTargetFeatureIds )
|
||||||
{
|
{
|
||||||
|
// skip if there are no features to select from!
|
||||||
|
if ( targetSource->featureCount() == 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
if ( targetSource->featureCount() > 0 && intersectSource->featureCount() > 0
|
// skip if intersect layer is empty, unless we are looking for disjoints
|
||||||
&& targetSource->featureCount() < intersectSource->featureCount() )
|
if ( intersectSource->featureCount() == 0 &&
|
||||||
|
!selectedPredicates.contains( Disjoint ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( targetSource->featureCount() > 0 && intersectSource->featureCount() > 0 &&
|
||||||
|
targetSource->featureCount() < intersectSource->featureCount() )
|
||||||
{
|
{
|
||||||
// joining FEWER features to a layer with MORE features. So we iterate over the FEW features and find matches from the MANY
|
// joining FEWER features to a layer with MORE features. So we iterate over the FEW features and find matches from the MANY
|
||||||
processByIteratingOverTargetSource( context, targetSource, intersectSource,
|
processByIteratingOverTargetSource( context, targetSource, intersectSource,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user