Skip to content

Commit

Permalink
[OGR provider] Do not return wkbUnknown25D, wkbUnknownM/Z/ZM layer ge…
Browse files Browse the repository at this point in the history
…ometry types

Those are illegal QgsWKBTypes::Type / QGis::WkbType values, and can cause
undefined behaviour outside of the provider.

Fixes #15064
  • Loading branch information
rouault committed Jun 18, 2016
1 parent aceef9e commit 7b7c377
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/providers/ogr/qgsogrprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,11 @@ OGRwkbGeometryType QgsOgrProvider::getOgrGeomType( OGRLayerH ogrLayer )
{
geomType = OGR_FD_GetGeomType( fdef );

// Handle wkbUnknown and its Z/M variants. QGIS has no unknown Z/M variants,
// so just use flat wkbUnknown
if ( wkbFlatten( geomType ) == wkbUnknown )
geomType = wkbUnknown;

// Some ogr drivers (e.g. GML) are not able to determine the geometry type of a layer like this.
// In such cases, we use virtual sublayers for each geometry if the layer contains
// multiple geometries (see subLayers) otherwise we guess geometry type from first feature
Expand Down

0 comments on commit 7b7c377

Please sign in to comment.