Hi Martin

On Tue, May 9, 2017 at 11:34 PM, Martin Landa <[email protected]> wrote:
> Hi,
>
> example of raster single band renderer in pyqgis cookbook [1] is based
> on predefined list of color rules items. Is it possible to generate
> rules items automatically from defined min&max values, number of
> classes, and classification mode (same when user clicks on 'Classify'
> button)?

In QGIS master (will be 3.0) there is
QgsSingleBandPseudoColorRenderer::createShader(...) method to do that,
however in 2.x that code is not accessible through API... you could
however still port the underlying classification code to your plugin:
https://github.com/qgis/QGIS/blob/release-2_18/src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp#L345

Cheers
Martin
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to