Skip to content
Browse files
[OGR provider] Do not return wkbUnknown25D, wkbUnknownM/Z/ZM layer ge…
…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 df8dca2 commit b0c519e33674428b1b451617922a6a7b6fcc94af
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/providers/ogr/qgsogrprovider.cpp
@@ -665,6 +665,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

0 comments on commit b0c519e

Please sign in to comment.