Skip to content

Commit 2502a33

Browse files
committedJun 4, 2018
[OGR provider] Custom GPKG implementation of GetExtent() only needed for GDAL < 2.4
1 parent 4f53135 commit 2502a33

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎src/providers/ogr/qgsogrprovider.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5229,6 +5229,7 @@ GIntBig QgsOgrLayer::GetApproxFeatureCount()
52295229
return OGR_L_GetFeatureCount( hLayer, TRUE );
52305230
}
52315231

5232+
#if GDAL_VERSION_NUM < GDAL_COMPUTE_VERSION(2,4,0)
52325233
static bool findMinOrMax( GDALDatasetH hDS, const QByteArray &rtreeName,
52335234
const char *varName, bool isMin, double &val )
52345235
{
@@ -5276,11 +5277,13 @@ static bool findMinOrMax( GDALDatasetH hDS, const QByteArray &rtreeName,
52765277
}
52775278
return true;
52785279
}
5280+
#endif
52795281

52805282
OGRErr QgsOgrLayer::GetExtent( OGREnvelope *psExtent, bool bForce )
52815283
{
52825284
QMutexLocker locker( &ds->mutex );
52835285

5286+
#if GDAL_VERSION_NUM < GDAL_COMPUTE_VERSION(2,4,0)
52845287
// OGR_L_GetExtent() can be super slow on huge geopackage files
52855288
// so implement some approximation strategy that has reasonable runtime.
52865289
// Actually this should return a rather accurante answer.
@@ -5323,6 +5326,8 @@ OGRErr QgsOgrLayer::GetExtent( OGREnvelope *psExtent, bool bForce )
53235326
return OGRERR_NONE;
53245327
}
53255328
}
5329+
#endif
5330+
53265331
return OGR_L_GetExtent( hLayer, psExtent, bForce );
53275332
}
53285333

0 commit comments

Comments
 (0)
Please sign in to comment.