Hi Michaƫl, On Thu, Feb 15, 2018 at 6:36 PM, kimaidou <kimai...@gmail.com> wrote:
> Hi all, > > I have a simple processing python alg which > * generates a buffer with qgis:buffer > * use qgis:fieldcalculator to add an buf_area field -> the output vector > of my alg is this buffer+new field. > > I would like to parse the features of the output vector in order to gather > some information and put it in a new string output. I have not been able to > get the layer object to perform a getFeatures on it. > > See the code > http://paste.debian.net/1010463/ > > In line 32, my blayer is None > I think I am not using the good way to get the output vector layer > features? I tried to use the same way as for reading an input layer, but > oviously it is different. > What does happen if you put area_result['OUTPUT'] directly instead of self.parameterAsSource? parameterAsSource() accept a parameter as first argument and area_result should be already un QgsVectorLayer. Where you are trying to execute it from? -- Salvatore Larosa linkedIn: http://linkedin.com/in/larosasalvatore twitter: @lrssvt skype: s.larosa IRC: lrssvt on freenode
_______________________________________________ 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