From 5ab034a35b2548dd325366fa6f1b23d144e12e0f Mon Sep 17 00:00:00 2001 From: Jiri Drbalek Date: Tue, 22 May 2018 13:18:26 +0000 Subject: [PATCH] gdal: Fix finding closest overview --- plugins/input/gdal/gdal_featureset.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/input/gdal/gdal_featureset.cpp b/plugins/input/gdal/gdal_featureset.cpp index ca3e81510..f21e32c70 100644 --- a/plugins/input/gdal/gdal_featureset.cpp +++ b/plugins/input/gdal/gdal_featureset.cpp @@ -215,8 +215,8 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) // we find an image size that most resembles the resolution of our output image. double width_res = std::get<0>(q.resolution()); double height_res = std::get<1>(q.resolution()); - int res_adjusted_raster_width = static_cast(std::floor(((double)raster_width_ * width_res) + .5)); - int res_adjusted_raster_height = static_cast(std::floor(((double)raster_height_ * height_res) + .5)); + int res_adjusted_raster_width = static_cast(std::floor(((double)raster_extent_.width() * width_res) + .5)); + int res_adjusted_raster_height = static_cast(std::floor(((double)raster_extent_.height() * height_res) + .5)); if (band_ > 0 && band_ < nbands_) { GDALRasterBand * band = dataset_.GetRasterBand(band_);