Skip to content

Commit

Permalink
GDALCreateGeoLocTransformer(): increase threshold to use GTiff geoloc…
Browse files Browse the repository at this point in the history
… working datasets to 24 megapixels

Fixes OSGeo#10809
  • Loading branch information
rouault committed Sep 16, 2024
1 parent 66841d5 commit 563780f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions alg/gdalgeoloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2006,14 +2006,20 @@ void *GDALCreateGeoLocTransformerEx(GDALDatasetH hBaseDS,
psTransform->bUseArray = !CPLTestBool(pszUseTempDatasets);
else
{
psTransform->bUseArray = nXSize < 16 * 1000 * 1000 / nYSize;
constexpr int MEGAPIXEL_LIMIT = 24;
psTransform->bUseArray =
nXSize < MEGAPIXEL_LIMIT * 1000 * 1000 / nYSize;
if (!psTransform->bUseArray)
{
CPLDebug("GEOLOC",
"Using temporary GTiff backing to store backmap, because "
"geoloc arrays exceed 16 megapixels. You can set the "
"geoloc arrays require %d megapixels, exceeding the %d "
"megapixels limit. You can set the "
"GDAL_GEOLOC_USE_TEMP_DATASETS configuration option to "
"NO to force RAM storage of backmap");
"NO to force RAM storage of backmap",
static_cast<int>(static_cast<int64_t>(nXSize) * nYSize /
(1000 * 1000)),
MEGAPIXEL_LIMIT);
}
}

Expand Down

0 comments on commit 563780f

Please sign in to comment.