import pprint
from osgeo import ogr
pprint.pprint(list(map(lambda f: (f, getattr(ogr, f)), list(filter(lambda x: x.startswith('wkb'), dir(ogr))))))
This gives us:
[('wkb25Bit', -2147483648),
('wkb25DBit', -2147483648),
('wkbCircularString', 8),
('wkbCircularStringM', 2008),
('wkbCircularStringZ', 1008),
('wkbCircularStringZM', 3008),
('wkbCompoundCurve', 9),
('wkbCompoundCurveM', 2009),
('wkbCompoundCurveZ', 1009),
('wkbCompoundCurveZM', 3009),
('wkbCurve', 13),
('wkbCurveM', 2013),
('wkbCurvePolygon', 10),
('wkbCurvePolygonM', 2010),
('wkbCurvePolygonZ', 1010),
('wkbCurvePolygonZM', 3010),
('wkbCurveZ', 1013),
('wkbCurveZM', 3013),
('wkbGeometryCollection', 7),
('wkbGeometryCollection25D', -2147483641),
('wkbGeometryCollectionM', 2007),
('wkbGeometryCollectionZM', 3007),
('wkbLineString', 2),
('wkbLineString25D', -2147483646),
('wkbLineStringM', 2002),
('wkbLineStringZM', 3002),
('wkbLinearRing', 101),
('wkbMultiCurve', 11),
('wkbMultiCurveM', 2011),
('wkbMultiCurveZ', 1011),
('wkbMultiCurveZM', 3011),
('wkbMultiLineString', 5),
('wkbMultiLineString25D', -2147483643),
('wkbMultiLineStringM', 2005),
('wkbMultiLineStringZM', 3005),
('wkbMultiPoint', 4),
('wkbMultiPoint25D', -2147483644),
('wkbMultiPointM', 2004),
('wkbMultiPointZM', 3004),
('wkbMultiPolygon', 6),
('wkbMultiPolygon25D', -2147483642),
('wkbMultiPolygonM', 2006),
('wkbMultiPolygonZM', 3006),
('wkbMultiSurface', 12),
('wkbMultiSurfaceM', 2012),
('wkbMultiSurfaceZ', 1012),
('wkbMultiSurfaceZM', 3012),
('wkbNDR', 1),
('wkbNone', 100),
('wkbPoint', 1),
('wkbPoint25D', -2147483647),
('wkbPointM', 2001),
('wkbPointZM', 3001),
('wkbPolygon', 3),
('wkbPolygon25D', -2147483645),
('wkbPolygonM', 2003),
('wkbPolygonZM', 3003),
('wkbPolyhedralSurface', 15),
('wkbPolyhedralSurfaceM', 2015),
('wkbPolyhedralSurfaceZ', 1015),
('wkbPolyhedralSurfaceZM', 3015),
('wkbSurface', 14),
('wkbSurfaceM', 2014),
('wkbSurfaceZ', 1014),
('wkbSurfaceZM', 3014),
('wkbTIN', 16),
('wkbTINM', 2016),
('wkbTINZ', 1016),
('wkbTINZM', 3016),
('wkbUnknown', 0),
('wkbXDR', 0)]
Not all of the above are actual types. The ones that are mostly relevant are from 1 to 7.
line 25,
for feature in layer:
doesn't seem to work if there is only one feature in a layer. I get*** TypeError: iter() returned non-iterator of type 'Layer'