diff --git a/plugins/input/gdal/gdal_featureset.cpp b/plugins/input/gdal/gdal_featureset.cpp index f71535fd6..8f755fdda 100644 --- a/plugins/input/gdal/gdal_featureset.cpp +++ b/plugins/input/gdal/gdal_featureset.cpp @@ -149,6 +149,9 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) box2d intersect = raster_extent_.intersect(q.get_bbox()); box2d box = t.forward(intersect); + // get the filter factor if it is set + 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())); double margin_y = 1.0 / (std::fabs(dy_) * std::get<1>(q.resolution())); @@ -224,7 +227,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 +247,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 +266,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 +286,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 +586,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 3e004c89a..adaf65526 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 007689275..6daa89831 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 c7507c08a..dd0c6261a 160000 --- a/test/data-visual +++ b/test/data-visual @@ -1 +1 @@ -Subproject commit c7507c08a942fe9bffe5916510d3969f765f16c2 +Subproject commit dd0c6261afb21d387df21890fd90f2915eea539d