QGIS API Documentation 3.99.0-Master (09f76ad7019)
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).
struct ArrowSchema * schema ()
 Access the output ArrowSchema from C++.
void setSchema (const QgsArrowSchema &schema)
 Set the ArrowSchema for the output of all future batches.
QgsArrowArrayStream toArrayStream (int batchSize=65536) const
 Export this iterator as an ArrowArrayStream.

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 325 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 590 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 746 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 730 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 618 of file qgsarrowiterator.cpp.

◆ schema()

struct ArrowSchema * QgsArrowIterator::schema ( )

Access the output ArrowSchema from C++.

Definition at line 595 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 600 of file qgsarrowiterator.cpp.

◆ toArrayStream()

QgsArrowArrayStream QgsArrowIterator::toArrayStream ( int batchSize = 65536) const

Export this iterator as an ArrowArrayStream.

Definition at line 610 of file qgsarrowiterator.cpp.


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