File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -314,6 +314,7 @@ class ATL_NO_VTABLE CShapefile :
314314 // OGR layers can lookup by fixed FID rather than ever-changing ShapeIndex
315315 // (Shape indices change when removing rows, and may change on OGR reload)
316316 std::map<long , long > _ogrFid2ShapeIndex;
317+ std::set<long > _deletedFids;
317318 bool _hasOgrFidMapping = false ;
318319
319320 // table is initialized in CreateNew or Open methods
@@ -503,6 +504,23 @@ class ATL_NO_VTABLE CShapefile :
503504 {
504505 _ogrFid2ShapeIndex.insert (std::make_pair (ogrFid, shapeIndex));
505506 }
507+ bool MarkShapeDeleted (long shapeIndex)
508+ {
509+ if (!_hasOgrFidMapping)
510+ return false ;
511+
512+ for (auto const & it : _ogrFid2ShapeIndex)
513+ if (it.second == shapeIndex)
514+ _deletedFids.insert (it.first );
515+ }
516+ std::set<long > GetDeletedShapeFIDs ()
517+ {
518+ return std::set<long >(_deletedFids);
519+ }
520+ void ClearDeleteShapeFIDs ()
521+ {
522+ _deletedFids.clear ();
523+ }
506524
507525 // give OGR layers the ability to retain visibility flags on reload
508526 bool GetVisibilityFlags (map<long , BYTE > &flags);
You can’t perform that action at this time.
0 commit comments