QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
QgsArrowIterator Class Reference

Wrapper for an Arrow reader of features from vector data provider or vector layer. More...

#include <qgsarrowiterator.h>

Public Member Functions

 QgsArrowIterator ()=default
 Construct invalid iterator.
 QgsArrowIterator (QgsFeatureIterator featureIterator)
 Construct iterator from an existing feature iterator.
QgsArrowArray nextFeatures (int n)
 Build an ArrowArray using the next n features (or fewer depending on the number of features remaining).
void setSchema (const QgsArrowSchema &schema)
 Set the ArrowSchema for the output of all future batches.

Static Public Member Functions

static QgsArrowSchema inferSchema (const QgsFields &fields, bool hasGeometry=false, const QgsCoordinateReferenceSystem &crs=QgsCoordinateReferenceSystem(), const QgsArrowInferSchemaOptions &options=QgsArrowInferSchemaOptions())
 Infer the QgsArrowSchema from components.
static QgsArrowSchema inferSchema (const QgsVectorLayer &layer, const QgsArrowInferSchemaOptions &options=QgsArrowInferSchemaOptions())
 Infer the QgsArrowSchema for a given QgsVectorLayer.

Detailed Description

Wrapper for an Arrow reader of features from vector data provider or vector layer.

Since
QGIS 4.0

Definition at line 265 of file qgsarrowiterator.h.

Constructor & Destructor Documentation

◆ QgsArrowIterator() [1/2]

QgsArrowIterator::QgsArrowIterator ( )
default

Construct invalid iterator.

◆ QgsArrowIterator() [2/2]

QgsArrowIterator::QgsArrowIterator ( QgsFeatureIterator featureIterator)
explicit

Construct iterator from an existing feature iterator.

Definition at line 474 of file qgsarrowiterator.cpp.

Member Function Documentation

◆ inferSchema() [1/2]

QgsArrowSchema QgsArrowIterator::inferSchema ( const QgsFields & fields,
bool hasGeometry = false,
const QgsCoordinateReferenceSystem & crs = QgsCoordinateReferenceSystem(),
const QgsArrowInferSchemaOptions & options = QgsArrowInferSchemaOptions() )
static

Infer the QgsArrowSchema from components.

Exceptions
QgsExceptionif one or more attribute fields is of an unsupported type.

Definition at line 618 of file qgsarrowiterator.cpp.

◆ inferSchema() [2/2]

QgsArrowSchema QgsArrowIterator::inferSchema ( const QgsVectorLayer & layer,
const QgsArrowInferSchemaOptions & options = QgsArrowInferSchemaOptions() )
static

Infer the QgsArrowSchema for a given QgsVectorLayer.

Exceptions
QgsExceptionif one or more attribute fields is of an unsupported type.

Definition at line 602 of file qgsarrowiterator.cpp.

◆ nextFeatures()

QgsArrowArray QgsArrowIterator::nextFeatures ( int n)

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 return false).

Exceptions
QgsExceptionif a feature's attribute cannot be appended to an ArrowArray of the requested type or on internal error when building the array.

Definition at line 490 of file qgsarrowiterator.cpp.

◆ setSchema()

void QgsArrowIterator::setSchema ( const QgsArrowSchema & schema)

Set the ArrowSchema for the output of all future batches.

This must be set before calling nextFeatures().

Definition at line 479 of file qgsarrowiterator.cpp.


The documentation for this class was generated from the following files: