[QGIS-Developer] [Qgis-user] processAlgorithm vs processFeature?
Ujaval Gandhi
ujaval at spatialthoughts.com
Mon Aug 23 19:55:06 PDT 2021
If your algorithm works on each feature independently, processFeature() is
preferred. If you need to work with layers, you need to use
processAlgorithm(). I demonstrate this with an example at
https://spatialthoughts.com/2019/04/05/geodesic-buffers-in-qgis/
On Mon, 23 Aug 2021 at 10:25 PM, C Hamilton <adenaculture at gmail.com> wrote:
> I discovered that it looks like there is another way to deal with
> processing algorithms. Rather than use processAlgorithm it looks like I can
> use prepareAlgorithm & processFeature. I have always used processAlgorithm
> and then iterated through the features.
>
> Is processFeature just as quick as using processAlgorithm (iterating
> through the features)? Is one method preferred over the other? I think for
> some algorithms using processFeature would make the code look cleaner. Are
> there any gotchas in using the processFeature method?
>
> Thanks,
>
> Calvin
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
--
[image: Logo] <https://spatialthoughts.com/>
Ujaval Gandhi
Spatial Thoughts
mobile: +91-8095684687
email: ujaval at spatialthoughts.com
[image: LinkedIn icon] <https://www.linkedin.com/in/spatialthoughts/> [image:
Twitter icon] <https://twitter.com/spatialthoughts>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20210824/27c7546d/attachment.html>
More information about the QGIS-Developer
mailing list