Skip to content

Commit

Permalink
[ogr] Don't try to resolve the geometry type for Personal Geodatabase…
Browse files Browse the repository at this point in the history
…s when listing layers

The PGeo OGR driver always reports Unknown Geometry types, which causes the fallback
of iterating through all features in all layers to occur when resolving the list
of sublayers. This is incredibly slow for large mdb files, so skip the geometry
type resolution here.

Fixes massive UI hang when opening an MDB file in QGIS

(cherry picked from commit ae635a7)
  • Loading branch information
nyalldawson committed Aug 8, 2020
1 parent e2c94df commit 1464b0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -832,7 +832,7 @@ void QgsOgrProvider::addSubLayerDetailsToSubLayerList( int i, QgsOgrLayer *layer
QString geometryColumnName;
OGRwkbGeometryType layerGeomType = wkbUnknown;
const bool slowGeomTypeRetrieval =
mGDALDriverName == QLatin1String( "OAPIF" ) || mGDALDriverName == QLatin1String( "WFS3" );
mGDALDriverName == QLatin1String( "OAPIF" ) || mGDALDriverName == QLatin1String( "WFS3" ) || mGDALDriverName == QLatin1String( "PGeo" );
if ( !slowGeomTypeRetrieval )
{
QgsOgrFeatureDefn &fdef = layer->GetLayerDefn();
Expand Down

0 comments on commit 1464b0c

Please sign in to comment.