Hi,

On 29/03/2016 13:00, Tom Chadwin wrote:
> Currently, I detect the geometry type of input layers (which the user
> supplies, so they could be anything) with layer.wkbType(). This fails
> (returning -2147483646) if the input layer has z/m values (and will probably
> also fail with eg curved geometries).

-2147483646 is actually QGis.WKBLineString25D, so this is the right
answer :)
But this is going to be removed in the future in favor of QgsWKBTypes

> 
> Is there a way to "flatten/simplify" newer/more complex geometry types into
> simple point/line/poly types?

From QgsVectorLayer, you can call geometryType().

From a QGis.WkbType you can call QGis.flatType()

You can also convert a QGis.WkbType to a (new) QgsWkbTypes with
QGis.fromOldWkbType and have access to QgsWkbTypes.flatType()

_______________________________________________
Qgis-developer mailing list
[email protected]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to