Thank you Matthias, those future optimization possibilities sound really
exciting.
Based on all your responses so far, I think I'd summarize that Processing
script developers should always go for the feature sink parameter
QgsProcessingParameterFeatureSink.
Given the info Nyall shared with
Hi Anita,
A QgsFeatureSink is an interface for accepting features. This can be a
QgsVectorLayer but does not have to be one. It can also be a spatial index,
a vector file writer or others.
I.e. your algorithm specifies that it produces "features" which can be sent
to a vector layer, another
Thank you very much, Thomas. This code comparison approach is very useful
indeed.
If FeatureSink covers all functions of VectorDestination and more, that still
leaves me wonder what is the downside of a FeatureSink
"Note: Consider using the more flexible QgsProcessingParameterFeatureSink
Hi,
Although, I do know the intend to recommend one against the other, doing
some code differences helps to sort out things.
They both inherits from same classes but the constructor for
QgsProcessingParameterFeatureSink accepts an additionnal arg bool
supportsAppend
Thank you Stefan,
I saw that note but was hoping some developer could shed light on what they
mean by "more flexible" and "wherever possible". I guess otherwise it's just
trial and error.
Regards,
Anita
On Wednesday, 19. October 2022 07:44:05 (+02:00), Stefan Giese (WhereGroup)
wrote:
Hi.
Does any one of you know the real difference between
QgsProcessingParameterVectorDestination versus
QgsProcessingParameterFeatureSink? They seem to be used interchangably in the
resources I can find.
Thank you.
Anita
___
QGIS-Developer mailing