mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-04 18:11:01 -05:00
Correctly calculate the max chunk level when no overview is available (#3771)
This commit is contained in:
@@ -413,7 +413,18 @@ void RawTileDataReader::initialize() {
|
||||
_padfTransform = geoTransform(_rasterXSize, _rasterYSize);
|
||||
}
|
||||
|
||||
_maxChunkLevel = _dataset->GetRasterBand(1)->GetOverviewCount();
|
||||
|
||||
|
||||
const int nOverviews = _dataset->GetRasterBand(1)->GetOverviewCount();
|
||||
if (nOverviews > 0) {
|
||||
_maxChunkLevel = nOverviews;
|
||||
}
|
||||
else {
|
||||
const int sizeLevel0 = _dataset->GetRasterBand(1)->GetXSize();
|
||||
const double diff = log2(sizeLevel0) - log2(_initData.dimensions.x);
|
||||
const double intdiff = diff >= 0 ? ceil(diff) : floor(diff);
|
||||
_maxChunkLevel = intdiff;
|
||||
}
|
||||
}
|
||||
|
||||
void RawTileDataReader::reset() {
|
||||
|
||||
Reference in New Issue
Block a user