Skip to content
Permalink
Browse files

spatialite provider: improve filterFids()

  • Loading branch information
jef-n committed Aug 11, 2015
1 parent 3898d84 commit 45d4dbe14431e5f2b3fb0b33af40566ee442527e
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/providers/spatialite/qgsspatialitefeatureiterator.cpp
@@ -208,12 +208,17 @@ QString QgsSpatiaLiteFeatureIterator::whereClauseFid()

QString QgsSpatiaLiteFeatureIterator::whereClauseFids()
{
QStringList whereClauses;
if ( mRequest.filterFids().isEmpty() )
return "";

QString expr = QString( "%1 IN (" ).arg( quotedPrimaryKey() ), delim;
foreach ( const QgsFeatureId featureId, mRequest.filterFids() )
{
whereClauses << QString( "%1=%2" ).arg( quotedPrimaryKey() ).arg( featureId );
expr += delim + QString::number( featureId );
delim = ",";
}
return whereClauses.isEmpty() ? "" : whereClauses.join( " OR " ).prepend( "(" ).append( ")" );
expr += ")";
return expr;
}

QString QgsSpatiaLiteFeatureIterator::whereClauseRect()

0 comments on commit 45d4dbe

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