Skip to content

Commit 88d15de

Browse files
committed
gdal raster contour/footprint/polygon: fix issue with temporary gpkg file on MacOS
Fixes #13794
1 parent 3a89b79 commit 88d15de

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

apps/gdalalg_raster_contour.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,11 @@ bool GDALRasterContourAlgorithm::RunStep(GDALPipelineStepRunContext &ctxt)
264264
poDstDS->MarkSuppressOnClose();
265265
if (bRet)
266266
bRet = poDstDS->FlushCache() == CE_None;
267+
#if !defined(__APPLE__)
268+
// For some unknown reason, unlinking the file on MacOSX
269+
// leads to later "disk I/O error". See https://github.com/OSGeo/gdal/issues/13794
267270
VSIUnlink(outputFilename.c_str());
271+
#endif
268272
}
269273
m_outputDataset.Set(std::unique_ptr<GDALDataset>(poDstDS));
270274
}

apps/gdalalg_raster_footprint.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,11 @@ bool GDALRasterFootprintAlgorithm::RunStep(GDALPipelineStepRunContext &ctxt)
347347
if (poRetDS && !m_standaloneStep && !outputFilename.empty())
348348
{
349349
bOK = poRetDS->FlushCache() == CE_None;
350+
#if !defined(__APPLE__)
351+
// For some unknown reason, unlinking the file on MacOSX
352+
// leads to later "disk I/O error". See https://github.com/OSGeo/gdal/issues/13794
350353
VSIUnlink(outputFilename.c_str());
354+
#endif
351355
poRetDS->MarkSuppressOnClose();
352356
}
353357
m_outputDataset.Set(std::unique_ptr<GDALDataset>(poRetDS));

apps/gdalalg_raster_polygonize.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,11 @@ bool GDALRasterPolygonizeAlgorithm::RunStep(GDALPipelineStepRunContext &ctxt)
284284
if (bTemporaryFile)
285285
{
286286
ret = poRetDS->FlushCache() == CE_None;
287+
#if !defined(__APPLE__)
288+
// For some unknown reason, unlinking the file on MacOSX
289+
// leads to later "disk I/O error". See https://github.com/OSGeo/gdal/issues/13794
287290
VSIUnlink(outputFilename.c_str());
291+
#endif
288292
}
289293

290294
m_outputDataset.Set(std::move(poRetDS));

0 commit comments

Comments
 (0)