diff --git a/plugins/input/gdal/gdal_featureset.cpp b/plugins/input/gdal/gdal_featureset.cpp index a7df2ed8b..02f2dd745 100644 --- a/plugins/input/gdal/gdal_featureset.cpp +++ b/plugins/input/gdal/gdal_featureset.cpp @@ -148,6 +148,7 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) view_transform t(raster_width_, raster_height_, raster_extent_, 0, 0); box2d intersect = raster_extent_.intersect(q.get_bbox()); box2d box = t.forward(intersect); + double filter_factor = q.get_filter_factor(); //size of resized output pixel in source image domain double margin_x = 1.0 / (std::fabs(dx_) * std::get<0>(q.resolution())); @@ -224,7 +225,7 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) { throw datasource_exception(CPLGetLastErrorMsg()); } - mapnik::raster_ptr raster = std::make_shared(feature_raster_extent, intersect, image, 0.0); + mapnik::raster_ptr raster = std::make_shared(feature_raster_extent, intersect, image, filter_factor); // set nodata value to be used in raster colorizer if (nodata_value_) raster->set_nodata(*nodata_value_); else raster->set_nodata(raster_nodata); @@ -244,7 +245,7 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) { throw datasource_exception(CPLGetLastErrorMsg()); } - mapnik::raster_ptr raster = std::make_shared(feature_raster_extent, intersect, image, 0.0); + mapnik::raster_ptr raster = std::make_shared(feature_raster_extent, intersect, image, filter_factor); // set nodata value to be used in raster colorizer if (nodata_value_) raster->set_nodata(*nodata_value_); else raster->set_nodata(raster_nodata); @@ -263,7 +264,7 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) { throw datasource_exception(CPLGetLastErrorMsg()); } - mapnik::raster_ptr raster = std::make_shared(feature_raster_extent, intersect, image, 0.0); + mapnik::raster_ptr raster = std::make_shared(feature_raster_extent, intersect, image, filter_factor); // set nodata value to be used in raster colorizer if (nodata_value_) raster->set_nodata(*nodata_value_); else raster->set_nodata(raster_nodata); @@ -283,7 +284,7 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) { throw datasource_exception(CPLGetLastErrorMsg()); } - mapnik::raster_ptr raster = std::make_shared(feature_raster_extent, intersect, image, 0.0); + mapnik::raster_ptr raster = std::make_shared(feature_raster_extent, intersect, image, filter_factor); // set nodata value to be used in raster colorizer if (nodata_value_) raster->set_nodata(*nodata_value_); else raster->set_nodata(raster_nodata); @@ -583,7 +584,7 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) } } } - mapnik::raster_ptr raster = std::make_shared(feature_raster_extent, intersect, image, 0.0); + mapnik::raster_ptr raster = std::make_shared(feature_raster_extent, intersect, image, filter_factor); // set nodata value to be used in raster colorizer if (nodata_value_) raster->set_nodata(*nodata_value_); else raster->set_nodata(raster_nodata); diff --git a/plugins/input/raster/raster_featureset.cpp b/plugins/input/raster/raster_featureset.cpp index d3a4680b5..7c2dae1b0 100644 --- a/plugins/input/raster/raster_featureset.cpp +++ b/plugins/input/raster/raster_featureset.cpp @@ -55,7 +55,8 @@ raster_featureset::raster_featureset(LookupPolicy const& policy, extent_(extent), bbox_(q.get_bbox()), curIter_(policy_.begin()), - endIter_(policy_.end()) + endIter_(policy_.end()), + filter_factor_(q.get_filter_factor()) { } @@ -115,7 +116,7 @@ feature_ptr raster_featureset::next() rem.maxy() + y_off + height); feature_raster_extent = t.backward(feature_raster_extent); mapnik::image_any data = reader->read(x_off, y_off, width, height); - mapnik::raster_ptr raster = std::make_shared(feature_raster_extent, intersect, std::move(data), 1.0); + mapnik::raster_ptr raster = std::make_shared(feature_raster_extent, intersect, std::move(data), filter_factor_); feature->set_raster(raster); } } diff --git a/plugins/input/raster/raster_featureset.hpp b/plugins/input/raster/raster_featureset.hpp index 9954ffd30..fa398fcd7 100644 --- a/plugins/input/raster/raster_featureset.hpp +++ b/plugins/input/raster/raster_featureset.hpp @@ -321,6 +321,7 @@ private: mapnik::box2d bbox_; iterator_type curIter_; iterator_type endIter_; + double filter_factor_; }; #endif // RASTER_FEATURESET_HPP diff --git a/test/data-visual b/test/data-visual index 0ca64e776..fd518f1f5 160000 --- a/test/data-visual +++ b/test/data-visual @@ -1 +1 @@ -Subproject commit 0ca64e7760dfd6b1573b7a8c65ede3521a5ea5c3 +Subproject commit fd518f1f512b8aea4ac740c2ce12c249616a291c