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");
         QString provLib="ogr";
        QgsVectorLayer* vl = 0;
        vl = new QgsVectorLayer( mPath, mBaseName, provLib );
        QgsVectorDataProvider *prov = vl->dataProvider();
        prov->addAttributes( attrList );
      vl->startEditing();
      QgsFeature f;
      featureList::Iterator it;
      for ( it = featureList.begin(); it != featureList.end();it++)
      {
         f = *it;
         vl->addFeature( f );
      }

      vl->updateExtents();
      vl->endEditCommand();
      vl->commitChanges();




maaza

_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to