Skip to content
Permalink
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 aceef9e commit 7b7c3773d87f07307cac2666c18faa0a611fe9cb
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/providers/ogr/qgsogrprovider.cpp
@@ -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

0 comments on commit 7b7c377

Please sign in to comment.
You can’t perform that action at this time.