Skip to content

Commit a98d126

Browse files
committed
GTiff: avoid a warning to be emitted when created RRD overviews
1 parent 8443ac6 commit a98d126

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

frmts/gtiff/gtiffdataset_write.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3276,6 +3276,7 @@ CPLErr GTiffDataset::IBuildOverviews(const char *pszResampling, int nOverviews,
32763276
/* generic handling. */
32773277
/* -------------------------------------------------------------------- */
32783278
bool bUseGenericHandling = false;
3279+
bool bUseRRD = false;
32793280
CPLStringList aosOptions(papszOptions);
32803281

32813282
const char *pszLocation = CSLFetchNameValue(papszOptions, "LOCATION");
@@ -3296,12 +3297,13 @@ CPLErr GTiffDataset::IBuildOverviews(const char *pszResampling, int nOverviews,
32963297
else if (pszLocation && EQUAL(pszLocation, "RRD"))
32973298
{
32983299
bUseGenericHandling = true;
3300+
bUseRRD = true;
32993301
aosOptions.SetNameValue("USE_RRD", "YES");
33003302
}
33013303
// Legacy
3302-
else if (CPLTestBool(
3303-
CSLFetchNameValueDef(papszOptions, "USE_RRD",
3304-
CPLGetConfigOption("USE_RRD", "NO"))) ||
3304+
else if ((bUseRRD = CPLTestBool(
3305+
CSLFetchNameValueDef(papszOptions, "USE_RRD",
3306+
CPLGetConfigOption("USE_RRD", "NO")))) ||
33053307
CPLTestBool(CSLFetchNameValueDef(
33063308
papszOptions, "TIFF_USE_OVR",
33073309
CPLGetConfigOption("TIFF_USE_OVR", "NO"))))
@@ -3331,7 +3333,7 @@ CPLErr GTiffDataset::IBuildOverviews(const char *pszResampling, int nOverviews,
33313333
return CE_Failure;
33323334
}
33333335

3334-
if (!m_bWriteEmptyTiles)
3336+
if (!m_bWriteEmptyTiles && !bUseRRD)
33353337
{
33363338
aosOptions.SetNameValue("SPARSE_OK", "YES");
33373339
}

0 commit comments

Comments
 (0)