diff --git a/plugins/input/gdal/gdal_featureset.cpp b/plugins/input/gdal/gdal_featureset.cpp index ef14f4bd7..1aeff3b12 100644 --- a/plugins/input/gdal/gdal_featureset.cpp +++ b/plugins/input/gdal/gdal_featureset.cpp @@ -131,12 +131,22 @@ void gdal_featureset::find_best_overview(int bandNumber, int & current_height) const { GDALRasterBand * band = dataset_.GetRasterBand(bandNumber); + find_best_overview(band, ideal_width, ideal_height, current_width, current_height); +} + +void gdal_featureset::find_best_overview(GDALRasterBand * band, + int ideal_width, + int ideal_height, + int & current_width, + int & current_height) const +{ int band_overviews = band->GetOverviewCount(); if (band_overviews > 0) { for (int b = 0; b < band_overviews; b++) { GDALRasterBand * overview = band->GetOverview(b); + find_best_overview(overview, ideal_width, ideal_height, current_width, current_height); int overview_width = overview->GetXSize(); int overview_height = overview->GetYSize(); if ((overview_width < current_width || diff --git a/plugins/input/gdal/gdal_featureset.hpp b/plugins/input/gdal/gdal_featureset.hpp index 8ca1bae56..33295c1a1 100644 --- a/plugins/input/gdal/gdal_featureset.hpp +++ b/plugins/input/gdal/gdal_featureset.hpp @@ -77,6 +77,12 @@ private: int ideal_height, int & current_width, int & current_height) const; + + void find_best_overview(GDALRasterBand * band, + int ideal_width, + int ideal_height, + int & current_width, + int & current_height) const; mapnik::feature_ptr get_feature(mapnik::query const& q); mapnik::feature_ptr get_feature_at_point(mapnik::coord2d const& p);