Skip to content
Browse files
[ogr] If we had to do a full table scan to resolve geometry types
for a sublayer, ensure that we store the geometry type in the
sublayer uri so that we don't have to do this scan again
when the sublayer uri is used to create a map layer
  • Loading branch information
nyalldawson committed Aug 19, 2021
1 parent 8568ed0 commit 011aa463e50bb74fa467b6785b9aec3c5f667504
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/core/providers/ogr/qgsogrproviderutils.cpp
@@ -2480,7 +2480,10 @@ QList< QgsProviderSublayerDetails > QgsOgrProviderUtils::querySubLayerList( int
details.setProviderKey( QStringLiteral( "ogr" ) );
details.setDriverName( driverName );

if ( fCount.size() > 1 )
// if we had to iterate through the table to find geometry types, make sure to include these
// in the uri for the sublayers (otherwise we'll be forced to re-do this iteration whenever
// the uri from the sublayer is used to construct an actual vector layer)
if ( details.wkbType() != QgsWkbTypes::Unknown )
parts.insert( QStringLiteral( "geometryType" ), ogrWkbGeometryTypeName( countIt.key() ) );
parts.remove( QStringLiteral( "geometryType" ) );

0 comments on commit 011aa46

Please sign in to comment.