[Qgis-developer] Vector File Creatioin
sailmcm at yahoo.com
Fri Sep 23 15:50:11 EDT 2011
I am wondering if I have to do to save the shape files. Below is the code I am using. I am able to create memory layers that I could save later. But I want to create many shapefiles and QGIS started to run out of memory when I was loading the memory shapefiles. Once I change the provider to OGR and give the path and basename, it gets a NULL provider.
Can some of the QGIS Master's help a novice?
QString mPath = ("c:/tmp/qgis/");
QString mBaseName = ("BikeNA");
QgsVectorLayer* vl = 0;
vl = new QgsVectorLayer( mPath, mBaseName, provLib );
QgsVectorDataProvider *prov = vl->dataProvider();
prov->addAttributes( attrList );
for ( it = featureList.begin(); it != featureList.end();it++)
f = *it;
vl->addFeature( f );
More information about the Qgis-developer