[Qgis-developer] How to detect a categorized/graduated 2.5D layer in Python

Matthias Kuhn matthias at opengis.ch
Thu Jul 7 01:52:48 PDT 2016


Hi Tom,

On 07/07/2016 10:12 AM, Tom Chadwin wrote:
> So you can use a 2.5D renderer, then change to eg categorized or graduated,
> and the stack of geometry generators (shadow, walls, roof) remains in place.
> I have to detect these latter types of renderers in Python. I do so by
> looking for that signature stack of symbol layers. This works.
> 
> However, I loop through every feature in a layer when doing this check, my
> vague thought being that some features might have different symbology, but
> that others might still be derived from 2.5D. The problem I have is that
> this slows things down to a crawl, with multiple layers and many features.
> 
> Therefore:
> 
> 1. Is it overkill to loop through all features - should I just check the
> first feature in each layer?

Or directly the symbols defined on the layer?
You could implemente the logic for graudated and rule based and if this
fails fallback to the current approach.

> 
> 2. Does anyone have a more efficient way of detecting these "derived from
> 2.5D" renderers?

The other thing I can think of is taking the layer variables as hint but
that's really brittle.

Matthias


> 
> Thanks
> 
> Tom
> 
> 
> 
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/How-to-detect-a-categorized-graduated-2-5D-layer-in-Python-tp5275092.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> 


More information about the Qgis-developer mailing list