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

(cherry picked from commit 7b283b3)
  • Loading branch information
nyalldawson authored and github-actions committed Jul 22, 2021
1 parent c93bcc1 commit 90359fc32fce5772568941d7cf54846dff9028d3
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/core/providers/ogr/qgsogrprovider.cpp
@@ -1042,7 +1042,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 );
@@ -1057,9 +1061,9 @@ OGRwkbGeometryType QgsOgrProvider::getOgrGeomType( const QString &driverName, OG
{
geomType = OGR_G_GetGeometryType( geometry );

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

0 comments on commit 90359fc

Please sign in to comment.