Bug report #14562

wkbType() does not contain all possibilities

Added by Mehmet Selim BILGIN almost 8 years ago. Updated almost 7 years ago.

Status:Closed
Priority:Normal
Assignee:-
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

Description

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:

iface.activeLayer().wkbType()

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

History

#1 Updated by Nyall Dawson almost 8 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 almost 8 years ago

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

#3 Updated by Alexander Bruy almost 7 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