[Qgis-developer] PyQGIS - detect layers without geometry

Tom Chadwin tom.chadwin at nnpa.org.uk
Mon Aug 10 09:00:06 PDT 2015


When iterating through layers, how can I include vectors layers, exclude
layers without geometry, and include rasters? At the moment, I have:

try:
    if layer.type() == 0:
        testDump = layer.rendererV2().dump()
    code goes here
except:
    pass

This seems very ugly to me...



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/PyQGIS-detect-layers-without-geometry-tp5219219.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.


More information about the Qgis-developer mailing list