hi all,

I am trying to delete feature from shape layer using feature id.the feature
id is deleted when deleted in order descending order.When trying to delete
randomly it is giving error message
if i delete fid = 1, the below error is shown.

ERROR 1: Attempt to read shape with feature id (2) out of available range.

this is what i am doing

 OGRFeature *delFeatur = poLayer->GetFeature(actualIndex);

 delFeatur->SetGeometryDirectly(NULL);
  poLayer->SetFeature(delFeatur);
  poLayer->DeleteFeature(actualIndex);

  OGRFeature::DestroyFeature( delFeatur );

 QString sql = QString( "REPACK %1" ).arg( poLayer->GetName() );
 reader->ExecuteSQL(sql.toLatin1().data(),NULL,NULL);

poLayer->SyncToDisk();

reader->SyncToDisk();



thanks,

hema
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to