diff --git a/python/core/qgsvectordataprovider.sip b/python/core/qgsvectordataprovider.sip index 44e0520c4ba..ef9ff79ed71 100644 --- a/python/core/qgsvectordataprovider.sip +++ b/python/core/qgsvectordataprovider.sip @@ -220,12 +220,6 @@ class QgsVectorDataProvider : QgsDataProvider */ virtual QHash palAttributeIndexNames() const; - /** - * Set whether provider should also return features that don't have - * associated geometry. false by default - */ - void enableGeometrylessFeatures( bool fetch ); - /** * check if provider supports type of field * @note added in 1.2 diff --git a/src/app/qgsattributetypeloaddialog.cpp b/src/app/qgsattributetypeloaddialog.cpp index 37b7922c04a..0eee1652260 100644 --- a/src/app/qgsattributetypeloaddialog.cpp +++ b/src/app/qgsattributetypeloaddialog.cpp @@ -127,9 +127,6 @@ void QgsAttributeTypeLoadDialog::createPreview( int fieldIndex, bool full ) return; } - QgsVectorDataProvider* dataProvider = vLayer->dataProvider(); - dataProvider->enableGeometrylessFeatures( true ); - QgsAttributeList attributeList = QgsAttributeList(); attributeList.append( idx ); attributeList.append( idx2 ); @@ -158,7 +155,6 @@ void QgsAttributeTypeLoadDialog::createPreview( int fieldIndex, bool full ) previewTableWidget->setItem( row, 1, new QTableWidgetItem( mit.key() ) ); } - dataProvider->enableGeometrylessFeatures( false ); } QMap &QgsAttributeTypeLoadDialog::valueMap() @@ -178,9 +174,6 @@ void QgsAttributeTypeLoadDialog::loadDataToValueMap() return; } - QgsVectorDataProvider* dataProvider = vLayer->dataProvider(); - dataProvider->enableGeometrylessFeatures( true ); - QgsAttributeList attributeList = QgsAttributeList(); attributeList.append( idx ); attributeList.append( idx2 ); @@ -196,7 +189,6 @@ void QgsAttributeTypeLoadDialog::loadDataToValueMap() mValueMap.insert( f.attribute( idx2 ).toString(), val ); } } - dataProvider->enableGeometrylessFeatures( false ); } diff --git a/src/core/qgsvectordataprovider.cpp b/src/core/qgsvectordataprovider.cpp index fa5a35f9a64..fbb9ea1d68b 100644 --- a/src/core/qgsvectordataprovider.cpp +++ b/src/core/qgsvectordataprovider.cpp @@ -30,7 +30,6 @@ QgsVectorDataProvider::QgsVectorDataProvider( QString uri ) : QgsDataProvider( uri ) , mCacheMinMaxDirty( true ) - , mFetchFeaturesWithoutGeom( true ) , mAttrPalIndexName( QgsAttrPalIndexNameHash() ) { QSettings settings; @@ -238,11 +237,6 @@ QgsAttributeList QgsVectorDataProvider::attributeIndexes() return list; } -void QgsVectorDataProvider::enableGeometrylessFeatures( bool fetch ) -{ - mFetchFeaturesWithoutGeom = fetch; -} - const QList< QgsVectorDataProvider::NativeType > &QgsVectorDataProvider::nativeTypes() const { return mNativeTypes; diff --git a/src/core/qgsvectordataprovider.h b/src/core/qgsvectordataprovider.h index d219db080b2..bdd71d71170 100644 --- a/src/core/qgsvectordataprovider.h +++ b/src/core/qgsvectordataprovider.h @@ -279,12 +279,6 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider */ virtual QgsAttrPalIndexNameHash palAttributeIndexNames() const { return mAttrPalIndexName; } - /** - * Set whether provider should also return features that don't have - * associated geometry. false by default - */ - void enableGeometrylessFeatures( bool fetch ); - /** * check if provider supports type of field * @note added in 1.2 diff --git a/src/providers/ogr/qgsogrfeatureiterator.cpp b/src/providers/ogr/qgsogrfeatureiterator.cpp index bcacf56f54d..8c46ce8be3f 100644 --- a/src/providers/ogr/qgsogrfeatureiterator.cpp +++ b/src/providers/ogr/qgsogrfeatureiterator.cpp @@ -101,14 +101,6 @@ bool QgsOgrFeatureIterator::nextFeature( QgsFeature& feature ) return false; } - // skip features without geometry - if ( !OGR_F_GetGeometryRef( fet ) && !P->mFetchFeaturesWithoutGeom ) - { - OGR_F_Destroy( fet ); - close(); - return false; - } - readFeature( fet, feature ); feature.setValid( true ); @@ -120,13 +112,6 @@ bool QgsOgrFeatureIterator::nextFeature( QgsFeature& feature ) while (( fet = OGR_L_GetNextFeature( P->ogrLayer ) ) ) { - // skip features without geometry - if ( !P->mFetchFeaturesWithoutGeom && !OGR_F_GetGeometryRef( fet ) ) - { - OGR_F_Destroy( fet ); - continue; - } - if ( !readFeature( fet, feature ) ) continue;