Skip to content
Permalink
Browse files
[ogr] Report ESRI multipatch GDB layers as multipolygonz layers
Apply the same workaround we use for multipatch shapefiles to
GDB sources
  • Loading branch information
nyalldawson committed Jul 21, 2021
1 parent a80e42b commit 7b283b33aec629a479f62f45cf4b3f7f93f534c1
Showing with 7 additions and 3 deletions.
  1. +5 −1 src/core/providers/ogr/qgsogrprovider.cpp
  2. +2 −2 src/core/providers/ogr/qgsogrproviderutils.cpp
@@ -701,7 +701,11 @@ OGRwkbGeometryType QgsOgrProvider::getOgrGeomType( const QString &driverName, OG
// In such cases, we use virtual sublayers for each geometry if the layer contains
// multiple geometries (see subLayers) otherwise we guess geometry type from the first
// feature that has a geometry (limit us to a few features, not the whole layer)
if ( geomType == wkbUnknown )
//
// For ESRI formats with a GeometryCollection25D type we also query features for the geometry type,
// as they may be ESRI MultiPatch files which we want to report as MultiPolygon25D types
if ( geomType == wkbUnknown
|| ( geomType == wkbGeometryCollection25D && ( driverName == QLatin1String( "ESRI Shapefile" ) || driverName == QLatin1String( "OpenFileGDB" ) || driverName == QLatin1String( "FileGDB" ) ) ) )
{
geomType = wkbNone;
OGR_L_ResetReading( ogrLayer );
@@ -2031,9 +2031,9 @@ OGRwkbGeometryType QgsOgrProviderUtils::resolveGeometryTypeForFeature( OGRFeatur
{
OGRwkbGeometryType gType = OGR_G_GetGeometryType( geom );

// Shapefile MultiPatch can be reported as GeometryCollectionZ of TINZ
// ESRI MultiPatch can be reported as GeometryCollectionZ of TINZ
if ( wkbFlatten( gType ) == wkbGeometryCollection &&
driverName == QLatin1String( "ESRI Shapefile" ) &&
( driverName == QLatin1String( "ESRI Shapefile" ) || driverName == QLatin1String( "OpenFileGDB" ) || driverName == QLatin1String( "FileGDB" ) ) &&
OGR_G_GetGeometryCount( geom ) >= 1 &&
wkbFlatten( OGR_G_GetGeometryType( OGR_G_GetGeometryRef( geom, 0 ) ) ) == wkbTIN )
{

0 comments on commit 7b283b3

Please sign in to comment.