Skip to content

Commit

Permalink
spatialite provider: prefer rowid as primary key where available (and…
Browse files Browse the repository at this point in the history
… some cleanups)

fixes #14575, fixes #14626
  • Loading branch information
jef-n committed Apr 9, 2016
1 parent 2897764 commit 1050174
Show file tree
Hide file tree
Showing 4 changed files with 377 additions and 385 deletions.
12 changes: 6 additions & 6 deletions src/providers/spatialite/qgsspatialitefeatureiterator.cpp
Expand Up @@ -378,7 +378,7 @@ QString QgsSpatiaLiteFeatureIterator::whereClauseRect()
}
else if ( rect.isFinite() )
{
if ( mSource->spatialIndexRTree )
if ( mSource->mSpatialIndexRTree )
{
// using the RTree spatial index
QString mbrFilter = QString( "xmin <= %1 AND " ).arg( qgsDoubleToString( rect.xMaximum() ) );
Expand All @@ -391,7 +391,7 @@ QString QgsSpatiaLiteFeatureIterator::whereClauseRect()
QgsSpatiaLiteProvider::quotedIdentifier( idxName ),
mbrFilter );
}
else if ( mSource->spatialIndexMbrCache )
else if ( mSource->mSpatialIndexMbrCache )
{
// using the MbrCache spatial index
QString idxName = QString( "cache_%1_%2" ).arg( mSource->mIndexTable, mSource->mIndexGeometry );
Expand Down Expand Up @@ -578,16 +578,16 @@ bool QgsSpatiaLiteFeatureIterator::prepareOrderBy( const QList<QgsFeatureRequest
QgsSpatiaLiteFeatureSource::QgsSpatiaLiteFeatureSource( const QgsSpatiaLiteProvider* p )
: mGeometryColumn( p->mGeometryColumn )
, mSubsetString( p->mSubsetString )
, mFields( p->attributeFields )
, mFields( p->mAttributeFields )
, mQuery( p->mQuery )
, isQuery( p->isQuery )
, mIsQuery( p->mIsQuery )
, mViewBased( p->mViewBased )
, mVShapeBased( p->mVShapeBased )
, mIndexTable( p->mIndexTable )
, mIndexGeometry( p->mIndexGeometry )
, mPrimaryKey( p->mPrimaryKey )
, spatialIndexRTree( p->spatialIndexRTree )
, spatialIndexMbrCache( p->spatialIndexMbrCache )
, mSpatialIndexRTree( p->mSpatialIndexRTree )
, mSpatialIndexMbrCache( p->mSpatialIndexMbrCache )
, mSqlitePath( p->mSqlitePath )
{
}
Expand Down
6 changes: 3 additions & 3 deletions src/providers/spatialite/qgsspatialitefeatureiterator.h
Expand Up @@ -39,14 +39,14 @@ class QgsSpatiaLiteFeatureSource : public QgsAbstractFeatureSource
QString mSubsetString;
QgsFields mFields;
QString mQuery;
bool isQuery;
bool mIsQuery;
bool mViewBased;
bool mVShapeBased;
QString mIndexTable;
QString mIndexGeometry;
QString mPrimaryKey;
bool spatialIndexRTree;
bool spatialIndexMbrCache;
bool mSpatialIndexRTree;
bool mSpatialIndexMbrCache;
QString mSqlitePath;

friend class QgsSpatiaLiteFeatureIterator;
Expand Down

0 comments on commit 1050174

Please sign in to comment.