QGIS API Documentation
2.6.0-Brighton
|
A convenience class for writing vector files to disk. More...
#include <qgsvectorlayerimport.h>
Public Member Functions | |
QgsVectorLayerImport (const QString &uri, const QString &provider, const QgsFields &fields, QGis::WkbType geometryType, const QgsCoordinateReferenceSystem *crs, bool overwrite=false, const QMap< QString, QVariant > *options=0, QProgressDialog *progress=0) | |
create a empty layer and add fields to it | |
ImportError | hasError () |
checks whether there were any errors | |
QString | errorMessage () |
retrieves error message | |
int | errorCount () const |
bool | addFeature (QgsFeature &feature) |
add feature to the new created layer | |
~QgsVectorLayerImport () | |
close the new created layer |
Static Public Member Functions | |
static ImportError | importLayer (QgsVectorLayer *layer, const QString &uri, const QString &providerKey, const QgsCoordinateReferenceSystem *destCRS, bool onlySelected=false, QString *errorMessage=0, bool skipAttributeCreation=false, QMap< QString, QVariant > *options=0, QProgressDialog *progress=0) |
Write contents of vector layer to a different datasource. |
Protected Member Functions | |
bool | flushBuffer () |
flush the buffer writing the features to the new layer | |
bool | createSpatialIndex () |
create index |
Protected Attributes | |
ImportError | mError |
contains error value | |
QString | mErrorMessage |
int | mErrorCount |
QgsVectorDataProvider * | mProvider |
QMap< int, int > | mOldToNewAttrIdx |
map attribute indexes to new field indexes | |
int | mAttributeCount |
QgsFeatureList | mFeatureBuffer |
QProgressDialog * | mProgress |
A convenience class for writing vector files to disk.
There are two possibilities how to use this class:
Currently supports only writing to shapefiles, but shouldn't be a problem to add capability to support other OGR-writable formats.
QgsVectorLayerImport::QgsVectorLayerImport | ( | const QString & | uri, |
const QString & | provider, | ||
const QgsFields & | fields, | ||
QGis::WkbType | geometryType, | ||
const QgsCoordinateReferenceSystem * | crs, | ||
bool | overwrite = false , |
||
const QMap< QString, QVariant > * | options = 0 , |
||
QProgressDialog * | progress = 0 |
||
) |
create a empty layer and add fields to it
QgsVectorLayerImport::~QgsVectorLayerImport | ( | ) |
close the new created layer
bool QgsVectorLayerImport::addFeature | ( | QgsFeature & | feature | ) |
add feature to the new created layer
|
protected |
create index
|
inline |
QString QgsVectorLayerImport::errorMessage | ( | ) |
retrieves error message
|
protected |
flush the buffer writing the features to the new layer
QgsVectorLayerImport::ImportError QgsVectorLayerImport::hasError | ( | ) |
checks whether there were any errors
|
static |
Write contents of vector layer to a different datasource.
|
protected |
|
protected |
contains error value
|
protected |
|
protected |
|
protected |
|
protected |
map attribute indexes to new field indexes
|
protected |
|
protected |