[gdal-dev] How to delete shapefile
bclay at ball.com
Tue Jun 16 16:40:25 EDT 2009
I am trying to delete a temporary shapefile after running a process with
the following code.
int GdalWrapper::DeleteDataset(const char *datasetName)
int status = -1;
if (datasetName != NULL)
OGRDataSource *dataSrc = OpenDatasetFile(datasetName);
if (dataSrc != NULL)
int refCnt = dataSrc->GetSummaryRefCount();
if (refCnt > 0)
int deleteOk =
if (deleteOk == TRUE)
status = 0;
mLastErrorMsg = "Can not delete requested
mLastErrorMsg = "Could not delete layer: ";
mLastErrorMsg += datasetName;
The TestCapability always returns FALSE. If I call DeleteLayer anyway I
get an unsupported operation error messege.
I am using GDAL 1.5.3 with Visual Studio 2005.
Is there an error in my code or a different way to delete a shapefile
using GDAL or do I have to go to the operating system and find all of
the files that make up the shapefile and delete them that way?
This message and any enclosures are intended only for the addressee. Please
notify the sender by email if you are not the intended recipient. If you are
not the intended recipient, you may not use, copy, disclose, or distribute this
message or its contents or enclosures to any other person and any such actions
may be unlawful. Ball reserves the right to monitor and review all messages
and enclosures sent to or from this email address.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gdal-dev