<div dir="ltr"><div dir="ltr"><div>In my KML Tools processing plugin algorithm I create a feature sink as follows:</div><div><br></div><div>(self.sinkPt, self.dest_id_pt) = self.parameterAsSink(self.parameters,<br>                self.PrmPointOutputLayer, self.context, fields,<br>                QgsWkbTypes.Point, epsg4326)<br></div><div><br></div><div>'fields' is of type QgsFields which are my predefined field names.As I am parsing a KML file, I may find that there is extended field data. Is it possible to add additional fields to my QgsFeatureSink on the fly or do I need to do a first pass through the data to determine all of the possible fields?</div><div><br></div><div>I am guessing that I will need to preprocess, but that effectively doubles the time it takes to process the KML and I am trying to make this as fast as possible.</div><div><br></div><div>I could process the entire file to objects in memory and then write them out, but I don't like doing that in case they are very large files.<br></div><div><br></div><div>Do you have any suggestions?</div><div><br></div><div>Thanks,</div><div><br></div><div>Calvin<br></div></div></div>