Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
spatialite provider: improve filterFids()
  • Loading branch information
jef-n committed Aug 11, 2015
1 parent 3898d84 commit 45d4dbe
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/providers/spatialite/qgsspatialitefeatureiterator.cpp
Expand Up @@ -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()
Expand Down

0 comments on commit 45d4dbe

Please sign in to comment.