QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
40 QgsDataProvider::ReadFlags flags )
48 return QStringLiteral(
"Generic vector file" );
71 return Qgis::VectorLayerTypeFlags();
77 return QgsFeatureSource::FeatureAvailability::NoFeaturesAvailable;
79 return QgsFeatureSource::FeatureAvailability::FeaturesAvailable;
106 return mErrors.isEmpty() ? QString() : mErrors.last();
131 Q_UNUSED( attributes )
137 Q_UNUSED( attributes )
143 Q_UNUSED( renamedAttributes )
161 Q_UNUSED( fieldIndex )
168 if ( fieldIndex < 0 || fieldIndex >= f.
count() )
169 return QgsFieldConstraints::Constraints();
181 Q_UNUSED( geometry_map )
215 mEncoding = QTextCodec::codecForName( e.toLocal8Bit().constData() );
216 if ( !mEncoding && e != QLatin1String(
"System" ) )
231 mEncoding = QTextCodec::codecForName(
"System" );
237 mEncoding = QTextCodec::codecForLocale();
239 Q_ASSERT( mEncoding );
246 return mEncoding->name();
254 QStringList abilitiesList;
260 abilitiesList += tr(
"Add Features" );
265 abilitiesList += tr(
"Delete Features" );
270 abilitiesList += tr(
"Change Attribute Values" );
275 abilitiesList += tr(
"Add Attributes" );
280 abilitiesList += tr(
"Delete Attributes" );
285 abilitiesList += tr(
"Rename Attributes" );
291 abilitiesList += tr(
"Create Spatial Index" );
296 abilitiesList += tr(
"Create Attribute Indexes" );
301 abilitiesList += tr(
"Fast Access to Features at ID" );
306 abilitiesList += tr(
"Change Geometries" );
311 abilitiesList += tr(
"Presimplify Geometries" );
316 abilitiesList += tr(
"Presimplify Geometries with Validity Check" );
321 abilitiesList += tr(
"Simultaneous Geometry and Attribute Updates" );
326 abilitiesList += tr(
"Transactions" );
331 abilitiesList += tr(
"Curved Geometries" );
336 abilitiesList += tr(
"Feature Symbology" );
339 return abilitiesList.join( QLatin1String(
", " ) );
350 QMap<QString, int> resultMap;
353 for (
int i = 0; i < fieldsCopy.
count(); ++i )
355 resultMap.insert( fieldsCopy.
at( i ).
name(), i );
383 QgsDebugMsgLevel( QStringLiteral(
"field name = %1 type = %2 length = %3 precision = %4" )
389 for (
const NativeType &nativeType : mNativeTypes )
391 QgsDebugMsgLevel( QStringLiteral(
"native field type = %1 min length = %2 max length = %3 min precision = %4 max precision = %5" )
392 .arg( QVariant::typeToName( nativeType.mType ) )
393 .arg( nativeType.mMinLen )
394 .arg( nativeType.mMaxLen )
395 .arg( nativeType.mMinPrec )
396 .arg( nativeType.mMaxPrec ), 2 );
404 if ( ( nativeType.mMinLen > 0 &&
field.
length() < nativeType.mMinLen ) ||
405 ( nativeType.mMaxLen > 0 &&
field.
length() > nativeType.mMaxLen ) )
415 if ( ( nativeType.mMinPrec > 0 &&
field.
precision() < nativeType.mMinPrec ) ||
416 ( nativeType.mMaxPrec > 0 &&
field.
precision() > nativeType.mMaxPrec ) )
427 QgsDebugMsg( QStringLiteral(
"no sufficient native type found" ) );
433 if ( index < 0 || index >=
fields().count() )
435 QgsDebugMsg(
"Warning: access requested to invalid field index: " + QString::number( index ) );
441 if ( !mCacheMinValues.contains( index ) )
444 return mCacheMinValues[index];
449 if ( index < 0 || index >=
fields().count() )
451 QgsDebugMsg(
"Warning: access requested to invalid field index: " + QString::number( index ) );
457 if ( !mCacheMaxValues.contains( index ) )
460 return mCacheMaxValues[index];
469 if ( index < 0 || index >=
fields().count() )
474 keys.append( index );
480 request.
setFilterExpression( QStringLiteral(
"\"%1\" ILIKE '%%2%'" ).arg( fieldName, substring ) );
487 const QString value = f.
attribute( index ).toString();
488 if ( !set.contains( value ) )
490 results.append( value );
494 if ( ( limit >= 0 && results.size() >= limit ) || ( feedback && feedback->
isCanceled() ) )
506 Q_UNUSED( parameters )
516 mCacheMinMaxDirty =
true;
517 mCacheMinValues.clear();
518 mCacheMaxValues.clear();
523 if ( !mCacheMinMaxDirty )
527 for (
int i = 0; i < flds.
count(); ++i )
529 if ( flds.
at( i ).
type() == QVariant::Int )
531 mCacheMinValues[i] = QVariant( std::numeric_limits<int>::max() );
532 mCacheMaxValues[i] = QVariant( std::numeric_limits<int>::lowest() );
534 else if ( flds.
at( i ).
type() == QVariant::LongLong )
536 mCacheMinValues[i] = QVariant( std::numeric_limits<qlonglong>::max() );
537 mCacheMaxValues[i] = QVariant( std::numeric_limits<qlonglong>::lowest() );
539 else if ( flds.
at( i ).
type() == QVariant::Double )
541 mCacheMinValues[i] = QVariant( std::numeric_limits<double>::max() );
542 mCacheMaxValues[i] = QVariant( std::numeric_limits<double>::lowest() );
547 mCacheMinValues[i] = QVariant();
548 mCacheMaxValues[i] = QVariant();
560 for (
const int attributeIndex : keys )
562 const QVariant &varValue = attrs.at( attributeIndex );
564 if ( varValue.isNull() )
567 switch ( flds.
at( attributeIndex ).
type() )
571 const int value = varValue.toInt();
572 if ( value < mCacheMinValues[ attributeIndex ].toInt() )
573 mCacheMinValues[ attributeIndex ] = value;
574 if ( value > mCacheMaxValues[ attributeIndex ].toInt() )
575 mCacheMaxValues[ attributeIndex ] = value;
578 case QVariant::LongLong:
580 const qlonglong value = varValue.toLongLong();
581 if ( value < mCacheMinValues[ attributeIndex ].toLongLong() )
582 mCacheMinValues[ attributeIndex ] = value;
583 if ( value > mCacheMaxValues[ attributeIndex ].toLongLong() )
584 mCacheMaxValues[ attributeIndex ] = value;
587 case QVariant::Double:
589 const double value = varValue.toDouble();
590 if ( value < mCacheMinValues[ attributeIndex ].toDouble() )
591 mCacheMinValues[attributeIndex ] = value;
592 if ( value > mCacheMaxValues[ attributeIndex ].toDouble() )
593 mCacheMaxValues[ attributeIndex ] = value;
596 case QVariant::DateTime:
598 const QDateTime value = varValue.toDateTime();
599 if ( value < mCacheMinValues[ attributeIndex ].toDateTime() || !mCacheMinValues[ attributeIndex ].
isValid() )
600 mCacheMinValues[attributeIndex ] = value;
601 if ( value > mCacheMaxValues[ attributeIndex ].toDateTime() || !mCacheMaxValues[ attributeIndex ].
isValid() )
602 mCacheMaxValues[ attributeIndex ] = value;
607 const QDate value = varValue.toDate();
608 if ( value < mCacheMinValues[ attributeIndex ].toDate() || !mCacheMinValues[ attributeIndex ].
isValid() )
609 mCacheMinValues[attributeIndex ] = value;
610 if ( value > mCacheMaxValues[ attributeIndex ].toDate() || !mCacheMaxValues[ attributeIndex ].
isValid() )
611 mCacheMaxValues[ attributeIndex ] = value;
616 const QTime value = varValue.toTime();
617 if ( value < mCacheMinValues[ attributeIndex ].toTime() || !mCacheMinValues[ attributeIndex ].
isValid() )
618 mCacheMinValues[attributeIndex ] = value;
619 if ( value > mCacheMaxValues[ attributeIndex ].toTime() || !mCacheMaxValues[ attributeIndex ].
isValid() )
620 mCacheMaxValues[ attributeIndex ] = value;
625 const QString value = varValue.toString();
626 if ( mCacheMinValues[ attributeIndex ].isNull() || value < mCacheMinValues[attributeIndex ].toString() )
628 mCacheMinValues[attributeIndex] = value;
630 if ( mCacheMaxValues[attributeIndex].isNull() || value > mCacheMaxValues[attributeIndex].toString() )
632 mCacheMaxValues[attributeIndex] = value;
640 mCacheMinMaxDirty =
false;
647 if ( !v.convert( type ) || value.isNull() )
648 v = QVariant( type );
658 static bool _compareEncodings(
const QString &s1,
const QString &s2 )
660 return s1.toLower() < s2.toLower();
665 static std::once_flag initialized;
666 std::call_once( initialized, [ = ]
668 const auto codecs { QTextCodec::availableCodecs() };
669 for (
const QByteArray &codec : codecs )
674 smEncodings <<
"BIG5";
675 smEncodings <<
"BIG5-HKSCS";
676 smEncodings <<
"EUCJP";
677 smEncodings <<
"EUCKR";
678 smEncodings <<
"GB2312";
679 smEncodings <<
"GBK";
680 smEncodings <<
"GB18030";
681 smEncodings <<
"JIS7";
682 smEncodings <<
"SHIFT-JIS";
683 smEncodings <<
"TSCII";
684 smEncodings <<
"UTF-8";
685 smEncodings <<
"UTF-16";
686 smEncodings <<
"KOI8-R";
687 smEncodings <<
"KOI8-U";
688 smEncodings <<
"ISO8859-1";
689 smEncodings <<
"ISO8859-2";
690 smEncodings <<
"ISO8859-3";
691 smEncodings <<
"ISO8859-4";
692 smEncodings <<
"ISO8859-5";
693 smEncodings <<
"ISO8859-6";
694 smEncodings <<
"ISO8859-7";
695 smEncodings <<
"ISO8859-8";
696 smEncodings <<
"ISO8859-8-I";
697 smEncodings <<
"ISO8859-9";
698 smEncodings <<
"ISO8859-10";
699 smEncodings <<
"ISO8859-11";
700 smEncodings <<
"ISO8859-12";
701 smEncodings <<
"ISO8859-13";
702 smEncodings <<
"ISO8859-14";
703 smEncodings <<
"ISO8859-15";
704 smEncodings <<
"IBM 850";
705 smEncodings <<
"IBM 866";
706 smEncodings <<
"CP874";
707 smEncodings <<
"CP1250";
708 smEncodings <<
"CP1251";
709 smEncodings <<
"CP1252";
710 smEncodings <<
"CP1253";
711 smEncodings <<
"CP1254";
712 smEncodings <<
"CP1255";
713 smEncodings <<
"CP1256";
714 smEncodings <<
"CP1257";
715 smEncodings <<
"CP1258";
716 smEncodings <<
"Apple Roman";
717 smEncodings <<
"TIS-620";
718 smEncodings <<
"System";
722 std::sort( sEncodings.begin(), sEncodings.end(), _compareEncodings );
736 return !mErrors.isEmpty();
773 return QSet<QgsMapLayerDependency>();
792 if ( geometry->
wkbType() == providerGeomType )
797 std::unique_ptr< QgsAbstractGeometry > outputGeom;
802 QgsCompoundCurve *compoundCurve = qgsgeometry_cast<QgsCompoundCurve *>( geometry );
805 if ( compoundCurve->
nCurves() == 1 )
807 const QgsCircularString *circularString = qgsgeometry_cast<const QgsCircularString *>( compoundCurve->
curveAt( 0 ) );
808 if ( circularString )
810 outputGeom.reset( circularString->
clone() );
822 outputGeom.reset( curveGeom );
830 if ( segmentizedGeom )
832 outputGeom.reset( segmentizedGeom );
841 if ( geomCollection )
843 if ( geomCollection->
addGeometry( outputGeom ? outputGeom->clone() : geometry->
clone() ) )
845 outputGeom.reset( collGeom.release() );
853 const QgsGeometryCollection *collection = qgsgeometry_cast<const QgsGeometryCollection *>( geometry );
859 if ( firstGeom && firstGeom->
wkbType() == providerGeomType )
861 outputGeom.reset( firstGeom->
clone() );
872 outputGeom.reset( geometry->
clone() );
881 outputGeom.reset( geometry->
clone() );
883 outputGeom->addMValue();
909 QStringList QgsVectorDataProvider::sEncodings;
913 return QList<QgsRelation>();
923 return mTemporalCapabilities.get();
928 return mTemporalCapabilities.get();
@ NoGeometry
Geometry is not required. It may still be returned if e.g. required for a filter condition.
virtual bool createAttributeIndex(int field)
Create an attribute index on the datasource.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QSet< int > QgsAttributeIds
@ NoCapabilities
Provider has no capabilities.
@ DeleteFeatures
Allows deletion of features.
void setNativeTypes(const QList< QgsVectorDataProvider::NativeType > &nativeTypes)
Set the list of native types supported by this provider.
virtual bool cancelReload()
Cancels the current reloading of data.
virtual bool deleteFeatures(const QgsFeatureIds &id)
Deletes one or more features from the provider.
@ SqlQuery
SQL query layer.
virtual bool createSpatialIndex()
Creates a spatial index on the datasource (if supported by the provider type).
bool hasErrors() const
Provider has errors to report.
virtual QString dataComment() const override
Returns a short comment for the data that this provider is providing access to (e....
virtual QgsAttributeList pkAttributeIndexes() const
Returns list of indexes of fields that make up the primary key.
virtual Qgis::DataProviderFlags flags() const
Returns the generic data provider flags.
Setting options for creating vector data providers.
@ TransactionSupport
Supports transactions.
@ DeleteAttributes
Allows deletion of attributes (fields)
Abstract base class for spatial data provider implementations.
virtual bool addZValue(double zValue=0)=0
Adds a z-dimension to the geometry, initialized to a preset value.
QgsRectangle sourceExtent() const override
Returns the extent of all geometries from the source.
void raiseError(const QString &msg) const
Signals an error in this provider.
void fillMinMaxCache() const
Populates the cache of minimum and maximum attribute values.
#define QgsDebugMsgLevel(str, level)
virtual void handlePostCloneOperations(QgsVectorDataProvider *source)
Handles any post-clone operations required after this vector data provider was cloned from the source...
A bundle of parameters controlling aggregate calculation.
QString encoding() const
Returns the encoding which is used for accessing data.
QgsFields fields() const override=0
Returns the fields associated with this data provider.
int nCurves() const SIP_HOLDGIL
Returns the number of curves in the geometry.
@ CreateSpatialIndex
Allows creation of spatial index.
virtual bool changeAttributeValues(const QgsChangedAttributesMap &attr_map)
Changes attribute values of existing features.
static Type flatType(Type type) SIP_HOLDGIL
Returns the flat type for a WKB type.
A QTextCodec implementation which relies on OGR to do the text conversion.
int count() const
Returns number of items.
Container of fields for a vector layer.
@ CreateAttributeIndex
Can create indexes on provider's fields.
int fieldNameIndex(const QString &fieldName) const
Returns the index of a field name or -1 if the field does not exist.
bool isCanceled() const SIP_HOLDGIL
Tells whether the operation has been canceled already.
virtual bool empty() const
Returns true if the layer does not contain any feature.
bool supportedType(const QgsField &field) const
check if provider supports type of field
virtual bool isDeleteStyleFromDatabaseSupported() const
It returns false by default.
@ AddAttributes
Allows addition of new attributes (fields)
virtual QgsTransaction * transaction() const
Returns the transaction this data provider is included in, if any.
virtual bool skipConstraintCheck(int fieldIndex, QgsFieldConstraints::Constraint constraint, const QVariant &value=QVariant()) const
Returns true if a constraint check should be skipped for a specified field (e.g., if the value return...
Type
The WKB type describes the number of dimensions a geometry has.
virtual bool isSaveAndLoadStyleToDatabaseSupported() const
It returns false by default.
This class allows including a set of layers in a database-side transaction, provided the layer data p...
QMap< QgsFeatureId, QgsAttributeMap > QgsChangedAttributesMap
QgsFeatureRequest & setSubsetOfAttributes(const QgsAttributeList &attrs)
Set a subset of attributes that will be fetched.
Constraint
Constraints which may be present on a field.
QgsFieldConstraints::Constraints fieldConstraints(int fieldIndex) const
Returns any constraints which are present at the provider for a specified field index.
QgsVectorDataProviderTemporalCapabilities * temporalCapabilities() override
Returns the provider's temporal capabilities.
QList< int > QgsAttributeList
virtual bool isSqlQuery() const
Returns true if the layer is a query (SQL) layer.
A rectangle specified with double values.
virtual void setEncoding(const QString &e)
Set encoding used for accessing data from layer.
@ FeatureSymbology
Provider is able retrieve embedded symbology associated with individual features. Since QGIS 3....
virtual QVariant defaultValue(int fieldIndex) const
Returns any literal default values which are present at the provider for a specified field index.
@ ChangeGeometries
Allows modifications of geometries.
void clearMinMaxCache()
Invalidates the min/max cache.
int numGeometries() const SIP_HOLDGIL
Returns the number of geometries within the collection.
const QgsCurve * curveAt(int i) const SIP_HOLDGIL
Returns the curve at the specified index.
QgsFeatureRequest & setFilterExpression(const QString &expression)
Set the filter expression.
virtual bool changeFeatures(const QgsChangedAttributesMap &attr_map, const QgsGeometryMap &geometry_map)
Changes attribute values and geometries of existing features.
@ SelectAtId
Fast access to features using their ID.
QStringList errors() const
Gets recorded errors.
This class wraps a request for features to a vector layer (or directly its vector data provider).
QList< QgsVectorDataProvider::NativeType > nativeTypes() const
Returns the names of the supported types.
virtual Q_INVOKABLE QgsVectorDataProvider::Capabilities capabilities() const
Returns flags containing the supported capabilities.
QMap< QString, int > fieldNameMap() const
Returns a map where the key is the name of the field and the value is its index.
virtual QVariant aggregate(QgsAggregateCalculator::Aggregate aggregate, int index, const QgsAggregateCalculator::AggregateParameters ¶meters, QgsExpressionContext *context, bool &ok, QgsFeatureIds *fids=nullptr) const
Calculates an aggregated value from the layer's features.
QVariant minimumValue(int index) const override
Returns the minimum value of an attribute.
Circular string geometry type.
QgsWkbTypes::Type wkbType() const SIP_HOLDGIL
Returns the WKB type of the geometry.
QgsCoordinateReferenceSystem sourceCrs() const override
Returns the coordinate reference system for features in the source.
virtual bool changeGeometryValues(const QgsGeometryMap &geometry_map)
Changes geometries of existing features.
virtual bool truncate()
Removes all features from the layer.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
virtual bool addGeometry(QgsAbstractGeometry *g)
Adds a geometry and takes ownership. Returns true in case of success.
QgsFeatureSource::FeatureAvailability hasFeatures() const override
Will always return FeatureAvailability::FeaturesAvailable or FeatureAvailability::NoFeaturesAvailable...
QgsVectorDataProvider(const QString &uri=QString(), const QgsDataProvider::ProviderOptions &providerOptions=QgsDataProvider::ProviderOptions(), QgsDataProvider::ReadFlags flags=QgsDataProvider::ReadFlags())
Constructor for a vector data provider.
virtual QSet< QgsMapLayerDependency > dependencies() const
Gets the list of layer ids on which this layer depends.
@ SimplifyGeometriesWithTopologicalValidation
Supports topological simplification of geometries on provider side according to a distance tolerance.
virtual QgsAbstractGeometry * clone() const =0
Clones the geometry by performing a deep copy.
virtual bool renameAttributes(const QgsFieldNameMap &renamedAttributes)
Renames existing attributes.
QList< QgsFeature > QgsFeatureList
static bool hasM(Type type) SIP_HOLDGIL
Tests whether a WKB type contains m values.
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::MessageLevel::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
virtual QgsFeatureRenderer * createRenderer(const QVariantMap &configuration=QVariantMap()) const
Creates a new vector layer feature renderer, using provider backend specific information.
@ AddFeatures
Allows adding features.
virtual QString storageType() const
Returns the permanent storage type for this layer as a friendly name.
QVariant attribute(const QString &name) const
Lookup attribute value by attribute name.
virtual QgsAttrPalIndexNameHash palAttributeIndexNames() const
Returns list of indexes to names for QgsPalLabeling fix.
virtual Qgis::VectorLayerTypeFlags vectorLayerTypeFlags() const
Returns the vector layer type flags.
QgsFeatureRequest & setNoAttributes()
Set that no attributes will be fetched.
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) const override=0
Query the provider for features specified in request.
const QgsAbstractGeometry * constGet() const SIP_HOLDGIL
Returns a non-modifiable (const) reference to the underlying abstract geometry primitive.
QSet< QgsFeatureId > QgsFeatureIds
This class represents a coordinate reference system (CRS).
Abstract base class for all geometries.
Abstract base class - its implementations define different approaches to the labeling of a vector lay...
virtual QgsAbstractGeometry * segmentize(double tolerance=M_PI/180., SegmentationToleranceType toleranceType=MaximumAngle) const
Returns a version of the geometry without curves.
void clearErrors()
Clear recorded errors.
static QStringList availableEncodings()
Returns a list of available encodings.
QgsGeometry convertToProviderType(const QgsGeometry &geom) const
Converts the geometry to the provider type if possible / necessary.
virtual QgsAttributeList attributeIndexes() const
Returns list of indexes to fetch all attributes in nextFeature()
FeatureAvailability
Possible return value for hasFeatures() to determine if a source is empty.
QgsAttributeList allAttributesList() const
Utility function to get list of attribute indexes.
virtual bool deleteAttributes(const QgsAttributeIds &attributes)
Deletes existing attributes from the provider.
static bool isCurvedType(Type type) SIP_HOLDGIL
Returns true if the WKB type is a curved type or can contain curved geometries.
bool addFeatures(QgsFeatureList &flist, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags()) override
Adds a list of features to the sink.
const QgsAbstractGeometry * geometryN(int n) const
Returns a const reference to a geometry from within the collection.
Aggregate
Available aggregates to calculate.
bool nextFeature(QgsFeature &f)
A geometry is the spatial representation of a feature.
@ ChangeAttributeValues
Allows modification of attribute values.
virtual QgsAbstractVectorLayerLabeling * createLabeling(const QVariantMap &configuration=QVariantMap()) const
Creates labeling settings, using provider backend specific information.
Represents a vector layer which manages a vector based data sets.
Implementation of data provider temporal properties for QgsVectorDataProviders.
QgsFeatureRequest & setLimit(long long limit)
Set the maximum number of features to request.
virtual QgsAbstractGeometry * toCurveType() const =0
Returns the geometry converted to the more generic curve type.
QVariant maximumValue(int index) const override
Returns the maximum value of an attribute.
virtual QgsRectangle extent() const =0
Returns the extent of the layer.
QMap< int, QString > QgsFieldNameMap
@ CircularGeometries
Supports circular geometry types (circularstring, compoundcurve, curvepolygon)
QString capabilitiesString() const
Returns the above in friendly format.
virtual bool addAttributes(const QList< QgsField > &attributes)
Adds new attributes to the provider.
QTextCodec * textEncoding() const
Gets this providers encoding.
QgsFieldConstraints constraints
@ ChangeFeatures
Supports joint updates for attributes and geometry. Providers supporting this should still define Cha...
QHash< int, QString > QgsAttrPalIndexNameHash
virtual QString defaultValueClause(int fieldIndex) const
Returns any default value clauses which are present at the provider for a specified field index.
@ RenameAttributes
Supports renaming attributes (fields). Since QGIS 2.16.
static bool hasZ(Type type) SIP_HOLDGIL
Tests whether a WKB type contains the z-dimension.
A vector of attributes. Mostly equal to QVector<QVariant>.
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
This is the base class for vector data providers.
static QStringList supportedCodecs()
Returns a list of supported text codecs.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
QString lastError() const override
Returns the most recent error encountered by the sink, e.g.
int lookupField(const QString &fieldName) const
Looks up field's index from the field name.
QgsField at(int i) const
Returns the field at particular index (must be in range 0..N-1).
static bool isMultiType(Type type) SIP_HOLDGIL
Returns true if the WKB type is a multi type.
virtual QStringList uniqueStringsMatching(int index, const QString &substring, int limit=-1, QgsFeedback *feedback=nullptr) const
Returns unique string values of an attribute which contain a specified subset string.
virtual QList< QgsRelation > discoverRelations(const QgsVectorLayer *target, const QList< QgsVectorLayer * > &layers) const
Discover the available relations with the given layers.
Wrapper for iterator of features from vector data provider or vector layer.
void pushError(const QString &msg) const
Push a notification about errors that happened in this providers scope.
static std::unique_ptr< QgsAbstractGeometry > geomFromWkbType(QgsWkbTypes::Type t)
Returns empty geometry from wkb type.
QgsCircularString * clone() const override
Clones the geometry by performing a deep copy.
static QVariant convertValue(QVariant::Type type, const QString &value)
QgsFeatureRequest & setFlags(QgsFeatureRequest::Flags flags)
Sets flags that affect how features will be fetched.
@ SimplifyGeometries
Supports simplification of geometries on provider side according to a distance tolerance.
QgsWkbTypes::Type wkbType() const override=0
Returns the geometry type which is returned by this layer.
virtual bool isValid() const =0
Returns true if this is a valid layer.
Compound curve geometry type.
virtual QgsCoordinateReferenceSystem crs() const =0
Returns the coordinate system for the data source.
Encapsulate a field in an attribute table or data source.