Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[ogr] Don't try to resolve the geometry type for Personal Geodatabase…
…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
  • Loading branch information
nyalldawson committed Aug 7, 2020
1 parent c23bc1f commit ae635a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -841,7 +841,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 ae635a7

Please sign in to comment.