Class: QgsArrowIterator¶
Wrapper for an Arrow reader of features from vector data provider or vector layer.
Added in version 4.0.
List of all members, including inherited members
Methods
Build an ArrowArray using the next n features (or fewer depending on the number of features remaining) |
|
Set the ArrowSchema for the output of all future batches |
|
Export this iterator as an ArrowArrayStream |
Static Methods
Infer the |
- class qgis.core.QgsArrowIterator[source]¶
Bases:
object- __init__()
Construct invalid iterator
- __init__(featureIterator: QgsFeatureIterator)
Construct iterator from an existing feature iterator
- Parameters:
featureIterator (QgsFeatureIterator)
- __init__(a0: QgsArrowIterator)
- Parameters:
a0 (QgsArrowIterator)
- static inferSchema(layer: QgsVectorLayer, options: QgsArrowInferSchemaOptions = QgsArrowInferSchemaOptions()) QgsArrowSchema[source]¶
Infer the
QgsArrowSchemafor a givenQgsVectorLayer- Raises:
QgsException – if one or more attribute fields is of an unsupported type.
inferSchema(fields:
QgsFields, hasGeometry: bool = False, crs:QgsCoordinateReferenceSystem= QgsCoordinateReferenceSystem(), options:QgsArrowInferSchemaOptions= QgsArrowInferSchemaOptions()) -> QgsArrowSchema Infer theQgsArrowSchemafrom components- Raises:
QgsException – if one or more attribute fields is of an unsupported type.
- Parameters:
layer (QgsVectorLayer)
options (
QgsArrowInferSchemaOptions= QgsArrowInferSchemaOptions())
- Return type:
- nextFeatures(self, n: int) QgsArrowArray[source]¶
Build an ArrowArray using the next n features (or fewer depending on the number of features remaining)
If no features remain, the returned array will be invalid (i.e.,
isValid()will returnFalse).- Raises:
QgsException – if a feature’s attribute cannot be appended to an ArrowArray of the requested type or on internal error when building the array.
- Parameters:
n (int)
- Return type:
- setSchema(self, schema: QgsArrowSchema)[source]¶
Set the ArrowSchema for the output of all future batches
This must be set before calling
nextFeatures().- Parameters:
schema (QgsArrowSchema)
- toArrayStream(self, batchSize: int = 65536) QgsArrowArrayStream[source]¶
Export this iterator as an ArrowArrayStream
- Parameters:
batchSize (int = 65536)
- Return type: