[Qgis-developer] geometryType differs in layer and provider

Ole Nielsen ole.moller.nielsen at gmail.com
Tue Dec 6 23:26:19 EST 2011


Hi QGis developers

Making great progress on day 2 of my journey into QGis. However, I was
puzzled by the geometryType apparently being different in layer and
provider.

The code snippet below produces the following output for a polygon layer:
------------------------------------
Geometry types
Point:  0
Line:  1
Polygon:  2
Layer geometry type 2
Provider geometry type 3
------------------------------------

so I am assuming the geometry type given by the layer object is the correct
one.
Can someone please confirm if this is correct and also perhaps comment on
what the geometry type in the provider means?
Many thanks
Ole


----------------- Code snippet ------------------------
print 'Geometry types'
print 'Point: ', QGis.Point
print 'Line: ', QGis.Line
print 'Polygon: ', QGis.Polygon

print 'Layer geometry type', layer.geometryType()

provider = layer.dataProvider()
print 'Provider geometry type', provider.geometryType()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20111207/99a1496e/attachment.html


More information about the Qgis-developer mailing list