Bug report #14562

wkbType() does not contain all possibilities

Added by Mehmet Selim BILGIN over 7 years ago. Updated over 6 years ago.

Category:Python plugins
Affected QGIS version:2.14.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:22535


A QgsVectorLayer object has wkbType() function that return geometry wkb type of layer. But this enum (http://qgis.org/api/classQGis.html#a8da456870e1caec209d8ba7502cceff7) does not contain all geometry types... For example I clicked add vector button than selected a KML file that contains multiple layer. QGIS showed me the dialog for selecting vector layers. It showed me layer names, feature counts and geometry types. One of the layer geometry type was LineString25D. I choosed it and added to canvas. Than I opened Python console in QGIS and checked the layers wkb type with this code:


it must return 9. Because of enum (wkbType) declared in here http://qgis.org/api/classQGis.html#a8da456870e1caec209d8ba7502cceff7 but it returned me -2147483646

wkbType.png (8.74 KB) Mehmet Selim BILGIN, 2016-03-24 05:02 AM


#1 Updated by Nyall Dawson over 7 years ago

Cannot be fixed until the 3.0 API break. See https://github.com/qgis/qgis3.0_api/issues/2

#2 Updated by Giovanni Manghi over 7 years ago

  • Target version set to Version 3.0
  • Category set to Python plugins

#3 Updated by Alexander Bruy over 6 years ago

  • Resolution set to fixed/implemented
  • Operating System deleted (Win7 64 bit)
  • Status changed from Open to Closed

Fixed in master

Also available in: Atom PDF