On Sat, 3 Nov 2018 at 07:27, C Hamilton <[email protected]> wrote:
>
> In my KML Tools processing plugin algorithm I create a feature sink as 
> follows:
>
> (self.sinkPt, self.dest_id_pt) = self.parameterAsSink(self.parameters,
>                 self.PrmPointOutputLayer, self.context, fields,
>                 QgsWkbTypes.Point, epsg4326)
>
> '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?

It's not possible. It could potentially be added to the QgsFeatureSink
API, but you'd run into problems with some underlying datasources not
having supported for creating attributes anyway. (Not all
providers/file formats allow creation of new fields within existing
layers).

Nyall
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to