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 <adenacult...@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-u...@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: uja...@spatialthoughts.com [image: LinkedIn icon] <https://www.linkedin.com/in/spatialthoughts/> [image: Twitter icon] <https://twitter.com/spatialthoughts>
_______________________________________________ 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