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?
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.
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.
Do you have any suggestions?
Thanks,
Calvin
_______________________________________________
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