QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgsvectordataprovider.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsvectordataprovider.cpp - DataProvider Interface for vector layers
3  --------------------------------------
4  Date : 26-Oct-2004
5  Copyright : (C) 2004 by Marco Hugentobler
6  email : [email protected]
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #include <QTextCodec>
17 
18 #include <cfloat>
19 #include <climits>
20 #include <limits>
21 
22 #include "qgsvectordataprovider.h"
23 #include "qgscircularstring.h"
24 #include "qgscompoundcurve.h"
25 #include "qgsfeature.h"
26 #include "qgsfeatureiterator.h"
27 #include "qgsfeaturerequest.h"
28 #include "qgsfeedback.h"
29 #include "qgsfields.h"
30 #include "qgsgeometry.h"
31 #include "qgsgeometrycollection.h"
32 #include "qgsgeometryfactory.h"
33 #include "qgslogger.h"
34 #include "qgsmessagelog.h"
35 #include "qgssettings.h"
36 #include <mutex>
37 
39  : QgsDataProvider( uri, options )
40  , mTemporalCapabilities( qgis::make_unique< QgsVectorDataProviderTemporalCapabilities >() )
41 {
42 }
43 
45 {
46  return QStringLiteral( "Generic vector file" );
47 }
48 
50 {
51  QgsFeature f;
52  QgsFeatureRequest request;
53  request.setNoAttributes();
55  request.setLimit( 1 );
56  if ( getFeatures( request ).nextFeature( f ) )
57  return false;
58  else
59  return true;
60 }
61 
63 {
64  if ( empty() )
65  return QgsFeatureSource::FeatureAvailability::NoFeaturesAvailable;
66  else
67  return QgsFeatureSource::FeatureAvailability::FeaturesAvailable;
68 }
69 
71 {
72  return crs();
73 }
74 
76 {
77  return extent();
78 }
79 
81 {
82  return QString();
83 }
84 
86 {
87  Q_UNUSED( flist )
88  Q_UNUSED( flags )
89  return false;
90 }
91 
93 {
94  Q_UNUSED( ids )
95  return false;
96 }
97 
99 {
100  if ( !( capabilities() & DeleteFeatures ) )
101  return false;
102 
103  QgsFeatureIds toDelete;
104  QgsFeatureIterator it = getFeatures( QgsFeatureRequest().setFlags( QgsFeatureRequest::NoGeometry ).setNoAttributes() );
105  QgsFeature f;
106  while ( it.nextFeature( f ) )
107  toDelete << f.id();
108 
109  return deleteFeatures( toDelete );
110 }
111 
112 bool QgsVectorDataProvider::addAttributes( const QList<QgsField> &attributes )
113 {
114  Q_UNUSED( attributes )
115  return false;
116 }
117 
119 {
120  Q_UNUSED( attributes )
121  return false;
122 }
123 
125 {
126  Q_UNUSED( renamedAttributes )
127  return false;
128 }
129 
131 {
132  Q_UNUSED( attr_map )
133  return false;
134 }
135 
136 QVariant QgsVectorDataProvider::defaultValue( int fieldId ) const
137 {
138  Q_UNUSED( fieldId )
139  return QVariant();
140 }
141 
142 QString QgsVectorDataProvider::defaultValueClause( int fieldIndex ) const
143 {
144  Q_UNUSED( fieldIndex )
145  return QString();
146 }
147 
148 QgsFieldConstraints::Constraints QgsVectorDataProvider::fieldConstraints( int fieldIndex ) const
149 {
150  QgsFields f = fields();
151  if ( fieldIndex < 0 || fieldIndex >= f.count() )
152  return nullptr;
153 
154  return f.at( fieldIndex ).constraints().constraints();
155 }
156 
158 {
159  return false;
160 }
161 
163 {
164  Q_UNUSED( geometry_map )
165  return false;
166 }
167 
169  const QgsGeometryMap &geometry_map )
170 {
172  return false;
173 
174  bool result = true;
175  result = result && changeAttributeValues( attr_map );
176  result = result && changeGeometryValues( geometry_map );
177  return result;
178 }
179 
181 {
182  return false;
183 }
184 
186 {
187  Q_UNUSED( field )
188  return true;
189 }
190 
191 QgsVectorDataProvider::Capabilities QgsVectorDataProvider::capabilities() const
192 {
194 }
195 
196 
197 void QgsVectorDataProvider::setEncoding( const QString &e )
198 {
199  mEncoding = QTextCodec::codecForName( e.toLocal8Bit().constData() );
200 
201  if ( !mEncoding && e != QLatin1String( "System" ) )
202  {
203  if ( !e.isEmpty() )
204  QgsMessageLog::logMessage( tr( "Codec %1 not found. Falling back to system locale" ).arg( e ) );
205  mEncoding = QTextCodec::codecForName( "System" );
206  }
207 
208  if ( !mEncoding )
209  mEncoding = QTextCodec::codecForLocale();
210 
211  Q_ASSERT( mEncoding );
212 }
213 
215 {
216  if ( mEncoding )
217  {
218  return mEncoding->name();
219  }
220 
221  return QString();
222 }
223 
225 {
226  QStringList abilitiesList;
227 
228  int abilities = capabilities();
229 
230  if ( abilities & QgsVectorDataProvider::AddFeatures )
231  {
232  abilitiesList += tr( "Add Features" );
233  }
234 
235  if ( abilities & QgsVectorDataProvider::DeleteFeatures )
236  {
237  abilitiesList += tr( "Delete Features" );
238  }
239 
241  {
242  abilitiesList += tr( "Change Attribute Values" );
243  }
244 
245  if ( abilities & QgsVectorDataProvider::AddAttributes )
246  {
247  abilitiesList += tr( "Add Attributes" );
248  }
249 
250  if ( abilities & QgsVectorDataProvider::DeleteAttributes )
251  {
252  abilitiesList += tr( "Delete Attributes" );
253  }
254 
255  if ( abilities & QgsVectorDataProvider::RenameAttributes )
256  {
257  abilitiesList += tr( "Rename Attributes" );
258  }
259 
261  {
262  // TODO: Tighten up this test. See QgsOgrProvider for details.
263  abilitiesList += tr( "Create Spatial Index" );
264  }
265 
267  {
268  abilitiesList += tr( "Create Attribute Indexes" );
269  }
270 
271  if ( abilities & QgsVectorDataProvider::SelectAtId )
272  {
273  abilitiesList += tr( "Fast Access to Features at ID" );
274  }
275 
276  if ( abilities & QgsVectorDataProvider::ChangeGeometries )
277  {
278  abilitiesList += tr( "Change Geometries" );
279  }
280 
282  {
283  abilitiesList += tr( "Presimplify Geometries" );
284  }
285 
287  {
288  abilitiesList += tr( "Presimplify Geometries with Validity Check" );
289  }
290 
291  if ( abilities & QgsVectorDataProvider::ChangeFeatures )
292  {
293  abilitiesList += tr( "Simultaneous Geometry and Attribute Updates" );
294  }
295 
297  {
298  abilitiesList += tr( "Transactions" );
299  }
300 
302  {
303  abilitiesList += tr( "Curved Geometries" );
304  }
305 
306  return abilitiesList.join( QStringLiteral( ", " ) );
307 }
308 
309 
310 int QgsVectorDataProvider::fieldNameIndex( const QString &fieldName ) const
311 {
312  return fields().lookupField( fieldName );
313 }
314 
315 QMap<QString, int> QgsVectorDataProvider::fieldNameMap() const
316 {
317  QMap<QString, int> resultMap;
318 
319  QgsFields fieldsCopy = fields();
320  for ( int i = 0; i < fieldsCopy.count(); ++i )
321  {
322  resultMap.insert( fieldsCopy.at( i ).name(), i );
323  }
324 
325  return resultMap;
326 }
327 
329 {
330  return fields().allAttributesList();
331 }
332 
334 {
335  return QgsAttributeList();
336 }
337 
338 QList<QgsVectorDataProvider::NativeType> QgsVectorDataProvider::nativeTypes() const
339 {
340  return mNativeTypes;
341 }
342 
344 {
345  return QgsAttrPalIndexNameHash();
346 }
347 
349 {
350  QgsDebugMsgLevel( QStringLiteral( "field name = %1 type = %2 length = %3 precision = %4" )
351  .arg( field.name(),
352  QVariant::typeToName( field.type() ) )
353  .arg( field.length() )
354  .arg( field.precision() ), 2 );
355 
356  const auto constMNativeTypes = mNativeTypes;
357  for ( const NativeType &nativeType : constMNativeTypes )
358  {
359  QgsDebugMsgLevel( QStringLiteral( "native field type = %1 min length = %2 max length = %3 min precision = %4 max precision = %5" )
360  .arg( QVariant::typeToName( nativeType.mType ) )
361  .arg( nativeType.mMinLen )
362  .arg( nativeType.mMaxLen )
363  .arg( nativeType.mMinPrec )
364  .arg( nativeType.mMaxPrec ), 2 );
365 
366  if ( field.type() != nativeType.mType )
367  continue;
368 
369  if ( field.length() > 0 )
370  {
371  // source length limited
372  if ( ( nativeType.mMinLen > 0 && field.length() < nativeType.mMinLen ) ||
373  ( nativeType.mMaxLen > 0 && field.length() > nativeType.mMaxLen ) )
374  {
375  // source length exceeds destination limits
376  continue;
377  }
378  }
379 
380  if ( field.precision() > 0 )
381  {
382  // source precision limited
383  if ( ( nativeType.mMinPrec > 0 && field.precision() < nativeType.mMinPrec ) ||
384  ( nativeType.mMaxPrec > 0 && field.precision() > nativeType.mMaxPrec ) )
385  {
386  // source precision exceeds destination limits
387  continue;
388  }
389  }
390 
391  QgsDebugMsgLevel( QStringLiteral( "native type matches" ), 3 );
392  return true;
393  }
394 
395  QgsDebugMsg( QStringLiteral( "no sufficient native type found" ) );
396  return false;
397 }
398 
399 QVariant QgsVectorDataProvider::minimumValue( int index ) const
400 {
401  if ( index < 0 || index >= fields().count() )
402  {
403  QgsDebugMsg( "Warning: access requested to invalid field index: " + QString::number( index ) );
404  return QVariant();
405  }
406 
407  fillMinMaxCache();
408 
409  if ( !mCacheMinValues.contains( index ) )
410  return QVariant();
411 
412  return mCacheMinValues[index];
413 }
414 
415 QVariant QgsVectorDataProvider::maximumValue( int index ) const
416 {
417  if ( index < 0 || index >= fields().count() )
418  {
419  QgsDebugMsg( "Warning: access requested to invalid field index: " + QString::number( index ) );
420  return QVariant();
421  }
422 
423  fillMinMaxCache();
424 
425  if ( !mCacheMaxValues.contains( index ) )
426  return QVariant();
427 
428  return mCacheMaxValues[index];
429 }
430 
431 
432 QStringList QgsVectorDataProvider::uniqueStringsMatching( int index, const QString &substring, int limit, QgsFeedback *feedback ) const
433 {
434  QStringList results;
435 
436  // Safety belt
437  if ( index < 0 || index >= fields().count() )
438  return results;
439 
440  QgsFeature f;
441  QgsAttributeList keys;
442  keys.append( index );
443 
444  QgsFeatureRequest request;
445  request.setSubsetOfAttributes( keys );
447  QString fieldName = fields().at( index ).name();
448  request.setFilterExpression( QStringLiteral( "\"%1\" ILIKE '%%2%'" ).arg( fieldName, substring ) );
449  QgsFeatureIterator fi = getFeatures( request );
450 
451  QSet<QString> set;
452 
453  while ( fi.nextFeature( f ) )
454  {
455  QString value = f.attribute( index ).toString();
456  if ( !set.contains( value ) )
457  {
458  results.append( value );
459  set.insert( value );
460  }
461 
462  if ( ( limit >= 0 && results.size() >= limit ) || ( feedback && feedback->isCanceled() ) )
463  break;
464  }
465  return results;
466 }
467 
469  const QgsAggregateCalculator::AggregateParameters &parameters, QgsExpressionContext *context, bool &ok, QgsFeatureIds *fids ) const
470 {
471  //base implementation does nothing
472  Q_UNUSED( aggregate )
473  Q_UNUSED( index )
474  Q_UNUSED( parameters )
475  Q_UNUSED( context )
476  Q_UNUSED( fids )
477 
478  ok = false;
479  return QVariant();
480 }
481 
483 {
484  mCacheMinMaxDirty = true;
485  mCacheMinValues.clear();
486  mCacheMaxValues.clear();
487 }
488 
490 {
491  if ( !mCacheMinMaxDirty )
492  return;
493 
494  QgsFields flds = fields();
495  for ( int i = 0; i < flds.count(); ++i )
496  {
497  if ( flds.at( i ).type() == QVariant::Int )
498  {
499  mCacheMinValues[i] = QVariant( std::numeric_limits<int>::max() );
500  mCacheMaxValues[i] = QVariant( std::numeric_limits<int>::lowest() );
501  }
502  else if ( flds.at( i ).type() == QVariant::LongLong )
503  {
504  mCacheMinValues[i] = QVariant( std::numeric_limits<qlonglong>::max() );
505  mCacheMaxValues[i] = QVariant( std::numeric_limits<qlonglong>::lowest() );
506  }
507  else if ( flds.at( i ).type() == QVariant::Double )
508  {
509  mCacheMinValues[i] = QVariant( std::numeric_limits<double>::max() );
510  mCacheMaxValues[i] = QVariant( std::numeric_limits<double>::lowest() );
511 
512  }
513  else
514  {
515  mCacheMinValues[i] = QVariant();
516  mCacheMaxValues[i] = QVariant();
517  }
518  }
519 
520  QgsFeature f;
521  const QgsAttributeList keys = mCacheMinValues.keys();
522  QgsFeatureIterator fi = getFeatures( QgsFeatureRequest().setSubsetOfAttributes( keys )
523  .setFlags( QgsFeatureRequest::NoGeometry ) );
524 
525  while ( fi.nextFeature( f ) )
526  {
527  QgsAttributes attrs = f.attributes();
528  for ( int attributeIndex : keys )
529  {
530  const QVariant &varValue = attrs.at( attributeIndex );
531 
532  if ( varValue.isNull() )
533  continue;
534 
535  switch ( flds.at( attributeIndex ).type() )
536  {
537  case QVariant::Int:
538  {
539  int value = varValue.toInt();
540  if ( value < mCacheMinValues[ attributeIndex ].toInt() )
541  mCacheMinValues[ attributeIndex ] = value;
542  if ( value > mCacheMaxValues[ attributeIndex ].toInt() )
543  mCacheMaxValues[ attributeIndex ] = value;
544  break;
545  }
546  case QVariant::LongLong:
547  {
548  qlonglong value = varValue.toLongLong();
549  if ( value < mCacheMinValues[ attributeIndex ].toLongLong() )
550  mCacheMinValues[ attributeIndex ] = value;
551  if ( value > mCacheMaxValues[ attributeIndex ].toLongLong() )
552  mCacheMaxValues[ attributeIndex ] = value;
553  break;
554  }
555  case QVariant::Double:
556  {
557  double value = varValue.toDouble();
558  if ( value < mCacheMinValues[ attributeIndex ].toDouble() )
559  mCacheMinValues[attributeIndex ] = value;
560  if ( value > mCacheMaxValues[ attributeIndex ].toDouble() )
561  mCacheMaxValues[ attributeIndex ] = value;
562  break;
563  }
564  case QVariant::DateTime:
565  {
566  QDateTime value = varValue.toDateTime();
567  if ( value < mCacheMinValues[ attributeIndex ].toDateTime() || !mCacheMinValues[ attributeIndex ].isValid() )
568  mCacheMinValues[attributeIndex ] = value;
569  if ( value > mCacheMaxValues[ attributeIndex ].toDateTime() || !mCacheMaxValues[ attributeIndex ].isValid() )
570  mCacheMaxValues[ attributeIndex ] = value;
571  break;
572  }
573  case QVariant::Date:
574  {
575  QDate value = varValue.toDate();
576  if ( value < mCacheMinValues[ attributeIndex ].toDate() || !mCacheMinValues[ attributeIndex ].isValid() )
577  mCacheMinValues[attributeIndex ] = value;
578  if ( value > mCacheMaxValues[ attributeIndex ].toDate() || !mCacheMaxValues[ attributeIndex ].isValid() )
579  mCacheMaxValues[ attributeIndex ] = value;
580  break;
581  }
582  case QVariant::Time:
583  {
584  QTime value = varValue.toTime();
585  if ( value < mCacheMinValues[ attributeIndex ].toTime() || !mCacheMinValues[ attributeIndex ].isValid() )
586  mCacheMinValues[attributeIndex ] = value;
587  if ( value > mCacheMaxValues[ attributeIndex ].toTime() || !mCacheMaxValues[ attributeIndex ].isValid() )
588  mCacheMaxValues[ attributeIndex ] = value;
589  break;
590  }
591  default:
592  {
593  QString value = varValue.toString();
594  if ( mCacheMinValues[ attributeIndex ].isNull() || value < mCacheMinValues[attributeIndex ].toString() )
595  {
596  mCacheMinValues[attributeIndex] = value;
597  }
598  if ( mCacheMaxValues[attributeIndex].isNull() || value > mCacheMaxValues[attributeIndex].toString() )
599  {
600  mCacheMaxValues[attributeIndex] = value;
601  }
602  break;
603  }
604  }
605  }
606  }
607 
608  mCacheMinMaxDirty = false;
609 }
610 
611 QVariant QgsVectorDataProvider::convertValue( QVariant::Type type, const QString &value )
612 {
613  QVariant v( value );
614 
615  if ( !v.convert( type ) || value.isNull() )
616  v = QVariant( type );
617 
618  return v;
619 }
620 
622 {
623  return nullptr;
624 }
625 
626 static bool _compareEncodings( const QString &s1, const QString &s2 )
627 {
628  return s1.toLower() < s2.toLower();
629 }
630 
632 {
633  static std::once_flag initialized;
634  std::call_once( initialized, [ = ]
635  {
636  const auto codecs { QTextCodec::availableCodecs() };
637  for ( const QString &codec : codecs )
638  {
639  sEncodings << codec;
640  }
641 #if 0
642  smEncodings << "BIG5";
643  smEncodings << "BIG5-HKSCS";
644  smEncodings << "EUCJP";
645  smEncodings << "EUCKR";
646  smEncodings << "GB2312";
647  smEncodings << "GBK";
648  smEncodings << "GB18030";
649  smEncodings << "JIS7";
650  smEncodings << "SHIFT-JIS";
651  smEncodings << "TSCII";
652  smEncodings << "UTF-8";
653  smEncodings << "UTF-16";
654  smEncodings << "KOI8-R";
655  smEncodings << "KOI8-U";
656  smEncodings << "ISO8859-1";
657  smEncodings << "ISO8859-2";
658  smEncodings << "ISO8859-3";
659  smEncodings << "ISO8859-4";
660  smEncodings << "ISO8859-5";
661  smEncodings << "ISO8859-6";
662  smEncodings << "ISO8859-7";
663  smEncodings << "ISO8859-8";
664  smEncodings << "ISO8859-8-I";
665  smEncodings << "ISO8859-9";
666  smEncodings << "ISO8859-10";
667  smEncodings << "ISO8859-11";
668  smEncodings << "ISO8859-12";
669  smEncodings << "ISO8859-13";
670  smEncodings << "ISO8859-14";
671  smEncodings << "ISO8859-15";
672  smEncodings << "IBM 850";
673  smEncodings << "IBM 866";
674  smEncodings << "CP874";
675  smEncodings << "CP1250";
676  smEncodings << "CP1251";
677  smEncodings << "CP1252";
678  smEncodings << "CP1253";
679  smEncodings << "CP1254";
680  smEncodings << "CP1255";
681  smEncodings << "CP1256";
682  smEncodings << "CP1257";
683  smEncodings << "CP1258";
684  smEncodings << "Apple Roman";
685  smEncodings << "TIS-620";
686  smEncodings << "System";
687 #endif
688 
689  // Do case-insensitive sorting of encodings
690  std::sort( sEncodings.begin(), sEncodings.end(), _compareEncodings );
691 
692  } );
693 
694  return sEncodings;
695 }
696 
698 {
699  mErrors.clear();
700 }
701 
703 {
704  return !mErrors.isEmpty();
705 }
706 
707 QStringList QgsVectorDataProvider::errors() const
708 {
709  return mErrors;
710 }
711 
713 {
714  return false;
715 }
716 
718 {
719  return false;
720 }
721 
723 {
724  return nullptr;
725 }
726 
728 {
729  return nullptr;
730 }
731 
732 void QgsVectorDataProvider::pushError( const QString &msg ) const
733 {
734  QgsDebugMsg( msg );
735  mErrors << msg;
736  emit raiseError( msg );
737 }
738 
739 QSet<QgsMapLayerDependency> QgsVectorDataProvider::dependencies() const
740 {
741  return QSet<QgsMapLayerDependency>();
742 }
743 
745 {
746  if ( geom.isNull() )
747  {
748  return QgsGeometry();
749  }
750 
751  const QgsAbstractGeometry *geometry = geom.constGet();
752  if ( !geometry )
753  {
754  return QgsGeometry();
755  }
756 
757  QgsWkbTypes::Type providerGeomType = wkbType();
758 
759  //geom is already in the provider geometry type
760  if ( geometry->wkbType() == providerGeomType )
761  {
762  return QgsGeometry();
763  }
764 
765  std::unique_ptr< QgsAbstractGeometry > outputGeom;
766 
767  //convert compoundcurve to circularstring (possible if compoundcurve consists of one circular string)
768  if ( QgsWkbTypes::flatType( providerGeomType ) == QgsWkbTypes::CircularString )
769  {
770  QgsCompoundCurve *compoundCurve = qgsgeometry_cast<QgsCompoundCurve *>( geometry );
771  if ( compoundCurve )
772  {
773  if ( compoundCurve->nCurves() == 1 )
774  {
775  const QgsCircularString *circularString = qgsgeometry_cast<const QgsCircularString *>( compoundCurve->curveAt( 0 ) );
776  if ( circularString )
777  {
778  outputGeom.reset( circularString->clone() );
779  }
780  }
781  }
782  }
783 
784  //convert to curved type if necessary
785  if ( !QgsWkbTypes::isCurvedType( geometry->wkbType() ) && QgsWkbTypes::isCurvedType( providerGeomType ) )
786  {
787  QgsAbstractGeometry *curveGeom = outputGeom ? outputGeom->toCurveType() : geometry->toCurveType();
788  if ( curveGeom )
789  {
790  outputGeom.reset( curveGeom );
791  }
792  }
793 
794  //convert to linear type from curved type
795  if ( QgsWkbTypes::isCurvedType( geometry->wkbType() ) && !QgsWkbTypes::isCurvedType( providerGeomType ) )
796  {
797  QgsAbstractGeometry *segmentizedGeom = outputGeom ? outputGeom->segmentize() : geometry->segmentize();
798  if ( segmentizedGeom )
799  {
800  outputGeom.reset( segmentizedGeom );
801  }
802  }
803 
804  //convert to multitype if necessary
805  if ( QgsWkbTypes::isMultiType( providerGeomType ) && !QgsWkbTypes::isMultiType( geometry->wkbType() ) )
806  {
807  std::unique_ptr< QgsAbstractGeometry > collGeom( QgsGeometryFactory::geomFromWkbType( providerGeomType ) );
808  QgsGeometryCollection *geomCollection = qgsgeometry_cast<QgsGeometryCollection *>( collGeom.get() );
809  if ( geomCollection )
810  {
811  if ( geomCollection->addGeometry( outputGeom ? outputGeom->clone() : geometry->clone() ) )
812  {
813  outputGeom.reset( collGeom.release() );
814  }
815  }
816  }
817 
818  //set z/m types
819  if ( QgsWkbTypes::hasZ( providerGeomType ) )
820  {
821  if ( !outputGeom )
822  {
823  outputGeom.reset( geometry->clone() );
824  }
825  outputGeom->addZValue();
826  }
827 
828  if ( QgsWkbTypes::hasM( providerGeomType ) )
829  {
830  if ( !outputGeom )
831  {
832  outputGeom.reset( geometry->clone() );
833  }
834  outputGeom->addMValue();
835  }
836 
837  if ( outputGeom )
838  {
839  return QgsGeometry( outputGeom.release() );
840  }
841 
842  return QgsGeometry();
843 }
844 
845 void QgsVectorDataProvider::setNativeTypes( const QList<NativeType> &nativeTypes )
846 {
847  mNativeTypes = nativeTypes;
848 }
849 
851 {
852  return mEncoding;
853 }
854 
856 {
857  return false;
858 }
859 
860 QStringList QgsVectorDataProvider::sEncodings;
861 
862 QList<QgsRelation> QgsVectorDataProvider::discoverRelations( const QgsVectorLayer *, const QList<QgsVectorLayer *> & ) const
863 {
864  return QList<QgsRelation>();
865 }
866 
868 {
869 
870 }
871 
873 {
874  return mTemporalCapabilities.get();
875 }
876 
878 {
879  return mTemporalCapabilities.get();
880 }
QgsFeatureRequest::NoGeometry
@ NoGeometry
Geometry is not required. It may still be returned if e.g. required for a filter condition.
Definition: qgsfeaturerequest.h:107
QgsVectorDataProvider::createAttributeIndex
virtual bool createAttributeIndex(int field)
Create an attribute index on the datasource.
Definition: qgsvectordataprovider.cpp:185
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition: qgsexpressioncontext.h:369
qgsfields.h
QgsAttributeIds
QSet< int > QgsAttributeIds
Definition: qgsvectordataprovider.h:39
QgsVectorDataProvider::NoCapabilities
@ NoCapabilities
Provider has no capabilities.
Definition: qgsvectordataprovider.h:74
QgsVectorDataProvider::DeleteFeatures
@ DeleteFeatures
Allows deletion of features.
Definition: qgsvectordataprovider.h:76
QgsVectorDataProvider::setNativeTypes
void setNativeTypes(const QList< QgsVectorDataProvider::NativeType > &nativeTypes)
Set the list of native types supported by this provider.
Definition: qgsvectordataprovider.cpp:845
QgsVectorDataProvider::cancelReload
virtual bool cancelReload()
Cancels the current reloading of data.
Definition: qgsvectordataprovider.cpp:855
QgsAbstractGeometry::wkbType
QgsWkbTypes::Type wkbType() const
Returns the WKB type of the geometry.
Definition: qgsabstractgeometry.h:189
QgsVectorDataProvider::deleteFeatures
virtual bool deleteFeatures(const QgsFeatureIds &id)
Deletes one or more features from the provider.
Definition: qgsvectordataprovider.cpp:92
QgsVectorDataProvider::createSpatialIndex
virtual bool createSpatialIndex()
Creates a spatial index on the datasource (if supported by the provider type).
Definition: qgsvectordataprovider.cpp:180
qgsfeaturerequest.h
QgsVectorDataProvider::hasErrors
bool hasErrors() const
Provider has errors to report.
Definition: qgsvectordataprovider.cpp:702
QgsVectorDataProvider::dataComment
virtual QString dataComment() const override
Returns a short comment for the data that this provider is providing access to (e....
Definition: qgsvectordataprovider.cpp:80
QgsVectorDataProvider::pkAttributeIndexes
virtual QgsAttributeList pkAttributeIndexes() const
Returns list of indexes of fields that make up the primary key.
Definition: qgsvectordataprovider.cpp:333
QgsDataProvider::ProviderOptions
Setting options for creating vector data providers.
Definition: qgsdataprovider.h:104
QgsVectorDataProvider::TransactionSupport
@ TransactionSupport
Supports transactions.
Definition: qgsvectordataprovider.h:87
QgsVectorDataProvider::DeleteAttributes
@ DeleteAttributes
Allows deletion of attributes (fields)
Definition: qgsvectordataprovider.h:79
QgsDataProvider
Definition: qgsdataprovider.h:41
QgsVectorDataProvider::sourceExtent
QgsRectangle sourceExtent() const override
Returns the extent of all geometries from the source.
Definition: qgsvectordataprovider.cpp:75
QgsVectorDataProvider::raiseError
void raiseError(const QString &msg) const
Signals an error in this provider.
QgsField::length
int length
Definition: qgsfield.h:55
QgsVectorDataProvider::fillMinMaxCache
void fillMinMaxCache() const
Populates the cache of minimum and maximum attribute values.
Definition: qgsvectordataprovider.cpp:489
QgsDebugMsgLevel
#define QgsDebugMsgLevel(str, level)
Definition: qgslogger.h:39
qgsgeometryfactory.h
QgsVectorDataProvider::handlePostCloneOperations
virtual void handlePostCloneOperations(QgsVectorDataProvider *source)
Handles any post-clone operations required after this vector data provider was cloned from the source...
Definition: qgsvectordataprovider.cpp:867
QgsAggregateCalculator::AggregateParameters
A bundle of parameters controlling aggregate calculation.
Definition: qgsaggregatecalculator.h:91
QgsVectorDataProvider::encoding
QString encoding() const
Returns the encoding which is used for accessing data.
Definition: qgsvectordataprovider.cpp:214
QgsVectorDataProvider::fields
QgsFields fields() const override=0
Returns the fields associated with this data provider.
QgsVectorDataProvider::CreateSpatialIndex
@ CreateSpatialIndex
Allows creation of spatial index.
Definition: qgsvectordataprovider.h:80
qgscompoundcurve.h
QgsVectorDataProvider::changeAttributeValues
virtual bool changeAttributeValues(const QgsChangedAttributesMap &attr_map)
Changes attribute values of existing features.
Definition: qgsvectordataprovider.cpp:130
QgsWkbTypes::isMultiType
static bool isMultiType(Type type)
Returns true if the WKB type is a multi type.
Definition: qgswkbtypes.h:831
qgsfeatureiterator.h
QgsFields::count
int count() const
Returns number of items.
Definition: qgsfields.cpp:133
QgsFields
Definition: qgsfields.h:44
QgsVectorDataProvider::QgsVectorDataProvider
QgsVectorDataProvider(const QString &uri=QString(), const QgsDataProvider::ProviderOptions &providerOptions=QgsDataProvider::ProviderOptions())
Constructor for a vector data provider.
Definition: qgsvectordataprovider.cpp:38
qgsfeature.h
QgsVectorDataProvider::CreateAttributeIndex
@ CreateAttributeIndex
Can create indexes on provider's fields.
Definition: qgsvectordataprovider.h:84
QgsVectorDataProvider::fieldNameIndex
int fieldNameIndex(const QString &fieldName) const
Returns the index of a field name or -1 if the field does not exist.
Definition: qgsvectordataprovider.cpp:310
QgsVectorDataProvider::empty
virtual bool empty() const
Returns true if the layer does not contain any feature.
Definition: qgsvectordataprovider.cpp:49
QgsVectorDataProvider::supportedType
bool supportedType(const QgsField &field) const
check if provider supports type of field
Definition: qgsvectordataprovider.cpp:348
QgsVectorDataProvider::isDeleteStyleFromDatabaseSupported
virtual bool isDeleteStyleFromDatabaseSupported() const
It returns false by default.
Definition: qgsvectordataprovider.cpp:717
QgsVectorDataProvider::AddAttributes
@ AddAttributes
Allows addition of new attributes (fields)
Definition: qgsvectordataprovider.h:78
QgsVectorDataProvider::transaction
virtual QgsTransaction * transaction() const
Returns the transaction this data provider is included in, if any.
Definition: qgsvectordataprovider.cpp:621
QgsVectorDataProvider::skipConstraintCheck
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...
Definition: qgsvectordataprovider.cpp:157
QgsWkbTypes::Type
Type
The WKB type describes the number of dimensions a geometry has.
Definition: qgswkbtypes.h:68
QgsVectorDataProvider::isSaveAndLoadStyleToDatabaseSupported
virtual bool isSaveAndLoadStyleToDatabaseSupported() const
It returns false by default.
Definition: qgsvectordataprovider.cpp:712
QgsTransaction
Definition: qgstransaction.h:56
QgsChangedAttributesMap
QMap< QgsFeatureId, QgsAttributeMap > QgsChangedAttributesMap
Definition: qgsfeature.h:558
QgsWkbTypes::hasZ
static bool hasZ(Type type)
Tests whether a WKB type contains the z-dimension.
Definition: qgswkbtypes.h:1042
QgsFeatureRequest::setSubsetOfAttributes
QgsFeatureRequest & setSubsetOfAttributes(const QgsAttributeList &attrs)
Set a subset of attributes that will be fetched.
Definition: qgsfeaturerequest.cpp:190
QgsDebugMsg
#define QgsDebugMsg(str)
Definition: qgslogger.h:38
QgsFieldConstraints::Constraint
Constraint
Constraints which may be present on a field.
Definition: qgsfieldconstraints.h:43
QgsVectorDataProvider::NativeType
Definition: qgsvectordataprovider.h:460
QgsVectorDataProvider::fieldConstraints
QgsFieldConstraints::Constraints fieldConstraints(int fieldIndex) const
Returns any constraints which are present at the provider for a specified field index.
Definition: qgsvectordataprovider.cpp:148
QgsVectorDataProvider::temporalCapabilities
QgsVectorDataProviderTemporalCapabilities * temporalCapabilities() override
Returns the provider's temporal capabilities.
Definition: qgsvectordataprovider.cpp:872
QgsAttributeList
QList< int > QgsAttributeList
Definition: qgsfield.h:26
QgsField::name
QString name
Definition: qgsfield.h:59
QgsRectangle
Definition: qgsrectangle.h:41
QgsVectorDataProvider::setEncoding
virtual void setEncoding(const QString &e)
Set encoding used for accessing data from layer.
Definition: qgsvectordataprovider.cpp:197
QgsVectorDataProvider::defaultValue
virtual QVariant defaultValue(int fieldIndex) const
Returns any literal default values which are present at the provider for a specified field index.
Definition: qgsvectordataprovider.cpp:136
QgsVectorDataProvider::ChangeGeometries
@ ChangeGeometries
Allows modifications of geometries.
Definition: qgsvectordataprovider.h:82
QgsVectorDataProvider::clearMinMaxCache
void clearMinMaxCache()
Invalidates the min/max cache.
Definition: qgsvectordataprovider.cpp:482
QgsFeatureRequest::setFilterExpression
QgsFeatureRequest & setFilterExpression(const QString &expression)
Set the filter expression.
Definition: qgsfeaturerequest.cpp:129
QgsVectorDataProvider::changeFeatures
virtual bool changeFeatures(const QgsChangedAttributesMap &attr_map, const QgsGeometryMap &geometry_map)
Changes attribute values and geometries of existing features.
Definition: qgsvectordataprovider.cpp:168
QgsVectorDataProvider::SelectAtId
@ SelectAtId
Fast access to features using their ID.
Definition: qgsvectordataprovider.h:81
QgsCompoundCurve::nCurves
int nCurves() const
Returns the number of curves in the geometry.
Definition: qgscompoundcurve.h:76
QgsField::precision
int precision
Definition: qgsfield.h:56
QgsFeature::id
QgsFeatureId id
Definition: qgsfeature.h:68
QgsVectorDataProvider::errors
QStringList errors() const
Gets recorded errors.
Definition: qgsvectordataprovider.cpp:707
QgsFeatureRequest
Definition: qgsfeaturerequest.h:75
QgsGeometryCollection
Geometry collection.
Definition: qgsgeometrycollection.h:35
QgsVectorDataProvider::nativeTypes
QList< QgsVectorDataProvider::NativeType > nativeTypes() const
Returns the names of the supported types.
Definition: qgsvectordataprovider.cpp:338
QgsVectorDataProvider::capabilities
virtual QgsVectorDataProvider::Capabilities capabilities() const
Returns flags containing the supported capabilities.
Definition: qgsvectordataprovider.cpp:191
QgsVectorDataProvider::fieldNameMap
QMap< QString, int > fieldNameMap() const
Returns a map where the key is the name of the field and the value is its index.
Definition: qgsvectordataprovider.cpp:315
QgsVectorDataProvider::aggregate
virtual QVariant aggregate(QgsAggregateCalculator::Aggregate aggregate, int index, const QgsAggregateCalculator::AggregateParameters &parameters, QgsExpressionContext *context, bool &ok, QgsFeatureIds *fids=nullptr) const
Calculates an aggregated value from the layer's features.
Definition: qgsvectordataprovider.cpp:468
QgsVectorDataProvider::minimumValue
QVariant minimumValue(int index) const override
Returns the minimum value of an attribute.
Definition: qgsvectordataprovider.cpp:399
QgsCircularString
Circular string geometry type.
Definition: qgscircularstring.h:34
QgsVectorDataProvider::sourceCrs
QgsCoordinateReferenceSystem sourceCrs() const override
Returns the coordinate reference system for features in the source.
Definition: qgsvectordataprovider.cpp:70
QgsVectorDataProvider::changeGeometryValues
virtual bool changeGeometryValues(const QgsGeometryMap &geometry_map)
Changes geometries of existing features.
Definition: qgsvectordataprovider.cpp:162
QgsVectorDataProvider::truncate
virtual bool truncate()
Removes all features from the layer.
Definition: qgsvectordataprovider.cpp:98
QgsFieldConstraints::constraints
Constraints constraints
Definition: qgsfieldconstraints.h:36
QgsFeedback
Definition: qgsfeedback.h:43
QgsGeometryCollection::addGeometry
virtual bool addGeometry(QgsAbstractGeometry *g)
Adds a geometry and takes ownership. Returns true in case of success.
Definition: qgsgeometrycollection.cpp:226
QgsVectorDataProvider::hasFeatures
QgsFeatureSource::FeatureAvailability hasFeatures() const override
Will always return FeatureAvailability::FeaturesAvailable or FeatureAvailability::NoFeaturesAvailable...
Definition: qgsvectordataprovider.cpp:62
QgsVectorDataProvider::dependencies
virtual QSet< QgsMapLayerDependency > dependencies() const
Gets the list of layer ids on which this layer depends.
Definition: qgsvectordataprovider.cpp:739
QgsVectorDataProvider::SimplifyGeometriesWithTopologicalValidation
@ SimplifyGeometriesWithTopologicalValidation
Supports topological simplification of geometries on provider side according to a distance tolerance.
Definition: qgsvectordataprovider.h:86
QgsAbstractGeometry::clone
virtual QgsAbstractGeometry * clone() const =0
Clones the geometry by performing a deep copy.
QgsVectorDataProvider::renameAttributes
virtual bool renameAttributes(const QgsFieldNameMap &renamedAttributes)
Renames existing attributes.
Definition: qgsvectordataprovider.cpp:124
qgsvectordataprovider.h
QgsFeatureList
QList< QgsFeature > QgsFeatureList
Definition: qgsfeature.h:572
QgsVectorDataProvider::createRenderer
virtual QgsFeatureRenderer * createRenderer(const QVariantMap &configuration=QVariantMap()) const
Creates a new vector layer feature renderer, using provider backend specific information.
Definition: qgsvectordataprovider.cpp:722
QgsVectorDataProvider::AddFeatures
@ AddFeatures
Allows adding features.
Definition: qgsvectordataprovider.h:75
QgsVectorDataProvider::storageType
virtual QString storageType() const
Returns the permanent storage type for this layer as a friendly name.
Definition: qgsvectordataprovider.cpp:44
QgsFeature::attribute
QVariant attribute(const QString &name) const
Lookup attribute value from attribute name.
Definition: qgsfeature.cpp:262
QgsGeometry::isNull
bool isNull
Definition: qgsgeometry.h:125
QgsVectorDataProvider::palAttributeIndexNames
virtual QgsAttrPalIndexNameHash palAttributeIndexNames() const
Returns list of indexes to names for QgsPalLabeling fix.
Definition: qgsvectordataprovider.cpp:343
QgsGeometry::constGet
const QgsAbstractGeometry * constGet() const
Returns a non-modifiable (const) reference to the underlying abstract geometry primitive.
Definition: qgsgeometry.cpp:128
QgsFeatureRequest::setNoAttributes
QgsFeatureRequest & setNoAttributes()
Set that no attributes will be fetched.
Definition: qgsfeaturerequest.cpp:197
QgsVectorDataProvider::getFeatures
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) const override=0
Query the provider for features specified in request.
QgsFeatureIds
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeatureid.h:34
qgscircularstring.h
QgsFeature::attributes
QgsAttributes attributes
Definition: qgsfeature.h:69
QgsCoordinateReferenceSystem
Definition: qgscoordinatereferencesystem.h:206
QgsAbstractGeometry
Abstract base class for all geometries.
Definition: qgsabstractgeometry.h:71
QgsAbstractVectorLayerLabeling
Definition: qgsvectorlayerlabeling.h:41
QgsAbstractGeometry::segmentize
virtual QgsAbstractGeometry * segmentize(double tolerance=M_PI/180., SegmentationToleranceType toleranceType=MaximumAngle) const
Returns a version of the geometry without curves.
Definition: qgsabstractgeometry.cpp:310
QgsVectorDataProvider::clearErrors
void clearErrors()
Clear recorded errors.
Definition: qgsvectordataprovider.cpp:697
QgsVectorDataProvider::availableEncodings
static QStringList availableEncodings()
Returns a list of available encodings.
Definition: qgsvectordataprovider.cpp:631
QgsVectorDataProvider::convertToProviderType
QgsGeometry convertToProviderType(const QgsGeometry &geom) const
Converts the geometry to the provider type if possible / necessary.
Definition: qgsvectordataprovider.cpp:744
QgsCompoundCurve::curveAt
const QgsCurve * curveAt(int i) const
Returns the curve at the specified index.
Definition: qgscompoundcurve.cpp:448
QgsFeedback::isCanceled
bool isCanceled() const
Tells whether the operation has been canceled already.
Definition: qgsfeedback.h:66
QgsVectorDataProvider::discoverRelations
virtual QList< QgsRelation > discoverRelations(const QgsVectorLayer *self, const QList< QgsVectorLayer * > &layers) const
Discover the available relations with the given layers.
Definition: qgsvectordataprovider.cpp:862
QgsVectorDataProvider::attributeIndexes
virtual QgsAttributeList attributeIndexes() const
Returns list of indexes to fetch all attributes in nextFeature()
Definition: qgsvectordataprovider.cpp:328
QgsFeatureSource::FeatureAvailability
FeatureAvailability
Possible return value for hasFeatures() to determine if a source is empty.
Definition: qgsfeaturesource.h:50
QgsFields::allAttributesList
QgsAttributeList allAttributesList() const
Utility function to get list of attribute indexes.
Definition: qgsfields.cpp:351
QgsVectorDataProvider::deleteAttributes
virtual bool deleteAttributes(const QgsAttributeIds &attributes)
Deletes existing attributes from the provider.
Definition: qgsvectordataprovider.cpp:118
QgsWkbTypes::hasM
static bool hasM(Type type)
Tests whether a WKB type contains m values.
Definition: qgswkbtypes.h:1092
QgsWkbTypes::CircularString
@ CircularString
Definition: qgswkbtypes.h:79
QgsVectorDataProvider::addFeatures
bool addFeatures(QgsFeatureList &flist, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags()) override
Adds a list of features to the sink.
Definition: qgsvectordataprovider.cpp:85
qgsgeometry.h
QgsAggregateCalculator::Aggregate
Aggregate
Available aggregates to calculate.
Definition: qgsaggregatecalculator.h:64
QgsFeatureRenderer
Definition: qgsrenderer.h:102
QgsFeatureIterator::nextFeature
bool nextFeature(QgsFeature &f)
Definition: qgsfeatureiterator.h:373
QgsGeometry
Definition: qgsgeometry.h:122
QgsVectorDataProvider::ChangeAttributeValues
@ ChangeAttributeValues
Allows modification of attribute values.
Definition: qgsvectordataprovider.h:77
QgsVectorDataProvider::createLabeling
virtual QgsAbstractVectorLayerLabeling * createLabeling(const QVariantMap &configuration=QVariantMap()) const
Creates labeling settings, using provider backend specific information.
Definition: qgsvectordataprovider.cpp:727
QgsVectorLayer
Definition: qgsvectorlayer.h:385
QgsVectorDataProviderTemporalCapabilities
Definition: qgsvectordataprovidertemporalcapabilities.h:37
QgsAbstractGeometry::toCurveType
virtual QgsAbstractGeometry * toCurveType() const =0
Returns the geometry converted to the more generic curve type.
QgsFeatureRequest::setLimit
QgsFeatureRequest & setLimit(long limit)
Set the maximum number of features to request.
Definition: qgsfeaturerequest.cpp:178
QgsVectorDataProvider::maximumValue
QVariant maximumValue(int index) const override
Returns the maximum value of an attribute.
Definition: qgsvectordataprovider.cpp:415
QgsDataProvider::extent
virtual QgsRectangle extent() const =0
Returns the extent of the layer.
qgssettings.h
QgsFieldNameMap
QMap< int, QString > QgsFieldNameMap
Definition: qgsattributes.h:44
QgsMessageLog::logMessage
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
Definition: qgsmessagelog.cpp:27
QgsVectorDataProvider::CircularGeometries
@ CircularGeometries
Supports circular geometry types (circularstring, compoundcurve, curvepolygon)
Definition: qgsvectordataprovider.h:88
QgsVectorDataProvider::capabilitiesString
QString capabilitiesString() const
Returns the above in friendly format.
Definition: qgsvectordataprovider.cpp:224
QgsVectorDataProvider::addAttributes
virtual bool addAttributes(const QList< QgsField > &attributes)
Adds new attributes to the provider.
Definition: qgsvectordataprovider.cpp:112
QgsVectorDataProvider::textEncoding
QTextCodec * textEncoding() const
Gets this providers encoding.
Definition: qgsvectordataprovider.cpp:850
QgsField::constraints
QgsFieldConstraints constraints
Definition: qgsfield.h:62
QgsWkbTypes::isCurvedType
static bool isCurvedType(Type type)
Returns true if the WKB type is a curved type or can contain curved geometries.
Definition: qgswkbtypes.h:880
QgsVectorDataProvider::ChangeFeatures
@ ChangeFeatures
Definition: qgsvectordataprovider.h:89
QgsAttrPalIndexNameHash
QHash< int, QString > QgsAttrPalIndexNameHash
Definition: qgsvectordataprovider.h:40
QgsVectorDataProvider::defaultValueClause
virtual QString defaultValueClause(int fieldIndex) const
Returns any default value clauses which are present at the provider for a specified field index.
Definition: qgsvectordataprovider.cpp:142
QgsVectorDataProvider::RenameAttributes
@ RenameAttributes
Supports joint updates for attributes and geometry Providers supporting this should still define Chan...
Definition: qgsvectordataprovider.h:92
QgsAttributes
Definition: qgsattributes.h:57
qgsgeometrycollection.h
QgsGeometryMap
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
Definition: qgsfeature.h:567
QgsVectorDataProvider
Definition: qgsvectordataprovider.h:58
QgsFeature
Definition: qgsfeature.h:55
qgslogger.h
QgsFields::lookupField
int lookupField(const QString &fieldName) const
Looks up field's index from the field name.
Definition: qgsfields.cpp:324
QgsFields::at
QgsField at(int i) const
Gets field at particular index (must be in range 0..N-1)
Definition: qgsfields.cpp:163
QgsVectorDataProvider::uniqueStringsMatching
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.
Definition: qgsvectordataprovider.cpp:432
QgsFeatureIterator
Definition: qgsfeatureiterator.h:263
QgsVectorDataProvider::pushError
void pushError(const QString &msg) const
Push a notification about errors that happened in this providers scope.
Definition: qgsvectordataprovider.cpp:732
QgsGeometryFactory::geomFromWkbType
static std::unique_ptr< QgsAbstractGeometry > geomFromWkbType(QgsWkbTypes::Type t)
Returns empty geometry from wkb type.
Definition: qgsgeometryfactory.cpp:228
qgsfeedback.h
QgsCircularString::clone
QgsCircularString * clone() const override
Clones the geometry by performing a deep copy.
Definition: qgscircularstring.cpp:123
QgsVectorDataProvider::convertValue
static QVariant convertValue(QVariant::Type type, const QString &value)
Definition: qgsvectordataprovider.cpp:611
QgsFeatureRequest::setFlags
QgsFeatureRequest & setFlags(QgsFeatureRequest::Flags flags)
Sets flags that affect how features will be fetched.
Definition: qgsfeaturerequest.cpp:184
QgsVectorDataProvider::SimplifyGeometries
@ SimplifyGeometries
Supports simplification of geometries on provider side according to a distance tolerance.
Definition: qgsvectordataprovider.h:85
QgsField::type
QVariant::Type type
Definition: qgsfield.h:57
QgsVectorDataProvider::wkbType
QgsWkbTypes::Type wkbType() const override=0
Returns the geometry type which is returned by this layer.
QgsWkbTypes::flatType
static Type flatType(Type type)
Returns the flat type for a WKB type.
Definition: qgswkbtypes.h:701
QgsDataProvider::isValid
virtual bool isValid() const =0
Returns true if this is a valid layer.
QgsCompoundCurve
Compound curve geometry type.
Definition: qgscompoundcurve.h:31
qgsmessagelog.h
QgsDataProvider::crs
virtual QgsCoordinateReferenceSystem crs() const =0
Returns the coordinate system for the data source.
QgsField
Definition: qgsfield.h:49