Re: [QGIS-Developer] Processing plugin - Set style on resulting layer
My bad ... Actually I was not using the output.getVectorWriter object the correct way. After fixing it the layer extracting from postgis by uri resulted in the default layer style from postgis to be add automatically using the getVectorWriter of the processing.core.outputs.OutputVector object. If would still be smart if one could have an after processAlgorithm signal for setting other stuff like adding feature count in TOC. Jakob - Jakob Lanstorp -- Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-f4099106.html ___ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [QGIS-Developer] Processing plugin - Set style on resulting layer
Yes, I would like to control the styling from my processing plugin code not by context menu. The end user is not to worry about where to find a qml style file. Jakob - Jakob Lanstorp -- Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-f4099106.html ___ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [QGIS-Developer] Processing plugin - Set style on resulting layer
On 5 January 2018 at 17:34, Alexander Bruy wrote: > Processing allows to define styles for outpus on the per-algorithm basis. > Just open algorithm context menu by right-clicking on it and select "Edit > rendering styles for outputs". In the dialog you can assign styles for each > algorithm output. These styles will be applied to outputs automatically > after algorithm execution. > > Hope this helps. That works for a user, but I think Jakob is after a way for an algorithm to define a style which is always used for the output for that algorithm. Is this correct? Nyall ___ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [QGIS-Developer] Processing plugin - Set style on resulting layer
Processing allows to define styles for outpus on the per-algorithm basis. Just open algorithm context menu by right-clicking on it and select "Edit rendering styles for outputs". In the dialog you can assign styles for each algorithm output. These styles will be applied to outputs automatically after algorithm execution. Hope this helps. 2018-01-05 3:49 GMT+02:00 Nyall Dawson : > On 3 January 2018 at 23:59, Jakob Lanstorp wrote: >> I'm building a Processing plugin used as an interface between QGIS and a >> geological PostGIS database. >> >> The resulting layer is as standard loaded automatically (Processing best >> practices). This resulting load (shapefile) happens after method >> processAlgorithm of GeoAlgorithm has run. >> >> This gives me no chance of setting the resulting layer style. Is there any >> post-processingAlgorithm method or anything else I can use? I'm aware of >> "qgis:setstyleforvectorlayer" but my script is not meant for the modeller >> and would like the algorithm to be run in one step not two steps. >> >> I may be out of scoop for what a Processing plugin is meant for - but like >> the non ui and direct algorithm approach. >> > > I don't believe this is possible in 2.x, nor currently in 3.0 either. > BUT - the API has changed significantly in 3.0 and could be expanded > to allow for this type of approach in future 3.x releases. > > Nyall > ___ > QGIS-Developer mailing list > QGIS-Developer@lists.osgeo.org > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer -- Alexander Bruy ___ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [QGIS-Developer] Processing plugin - Set style on resulting layer
On 3 January 2018 at 23:59, Jakob Lanstorp wrote: > I'm building a Processing plugin used as an interface between QGIS and a > geological PostGIS database. > > The resulting layer is as standard loaded automatically (Processing best > practices). This resulting load (shapefile) happens after method > processAlgorithm of GeoAlgorithm has run. > > This gives me no chance of setting the resulting layer style. Is there any > post-processingAlgorithm method or anything else I can use? I'm aware of > "qgis:setstyleforvectorlayer" but my script is not meant for the modeller > and would like the algorithm to be run in one step not two steps. > > I may be out of scoop for what a Processing plugin is meant for - but like > the non ui and direct algorithm approach. > I don't believe this is possible in 2.x, nor currently in 3.0 either. BUT - the API has changed significantly in 3.0 and could be expanded to allow for this type of approach in future 3.x releases. Nyall ___ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer