From 0fb717486ce88ef2137785252be9bb73843f6a4b Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Tue, 20 Dec 2011 16:12:37 -0500 Subject: [PATCH] Adds unbuffered_extent_ to queries from feature_style_processor. Creates a new constructor for query. Currently this is used by the jit_datasource. --- include/mapnik/query.hpp | 36 +++++++++++++++++++++++++++++---- src/feature_style_processor.cpp | 3 ++- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/include/mapnik/query.hpp b/include/mapnik/query.hpp index db607c587..4b468efa4 100644 --- a/include/mapnik/query.hpp +++ b/include/mapnik/query.hpp @@ -45,21 +45,37 @@ private: resolution_type resolution_; double scale_denominator_; double filter_factor_; + box2d unbuffered_bbox_; std::set names_; public: - - query(box2d const& bbox, resolution_type const& resolution, double scale_denominator = 1.0) + + query(box2d const& bbox, + resolution_type const& resolution, + double scale_denominator, + box2d const& unbuffered_bbox) : bbox_(bbox), resolution_(resolution), scale_denominator_(scale_denominator), - filter_factor_(1.0) + filter_factor_(1.0), + unbuffered_bbox_(unbuffered_bbox) + {} + + query(box2d const& bbox, + resolution_type const& resolution, + double scale_denominator = 1.0) + : bbox_(bbox), + resolution_(resolution), + scale_denominator_(scale_denominator), + filter_factor_(1.0), + unbuffered_bbox_(bbox) {} query(box2d const& bbox) : bbox_(bbox), resolution_(resolution_type(1.0,1.0)), scale_denominator_(1.0), - filter_factor_(1.0) + filter_factor_(1.0), + unbuffered_bbox_(bbox) {} query(query const& other) @@ -67,6 +83,7 @@ public: resolution_(other.resolution_), scale_denominator_(other.scale_denominator_), filter_factor_(other.filter_factor_), + unbuffered_bbox_(other.unbuffered_bbox_), names_(other.names_) {} @@ -78,6 +95,7 @@ public: scale_denominator_=other.scale_denominator_; filter_factor_=other.filter_factor_; names_=other.names_; + unbuffered_bbox_=other.unbuffered_bbox_; return *this; } @@ -96,6 +114,16 @@ public: return bbox_; } + box2d const& get_unbuffered_bbox() const + { + return unbuffered_bbox_; + } + + void set_unbuffered_bbox(const box2d& bbox) + { + unbuffered_bbox_ = bbox; + } + void set_bbox(const box2d& bbox) { bbox_ = bbox; diff --git a/src/feature_style_processor.cpp b/src/feature_style_processor.cpp index a077c37d3..ee9581288 100644 --- a/src/feature_style_processor.cpp +++ b/src/feature_style_processor.cpp @@ -265,11 +265,12 @@ void feature_style_processor::apply_to_layer(layer const& lay, Proces } box2d query_ext = m_.get_current_extent(); + box2d unbuffered_extent = m_.get_current_extent(); prj_trans.forward(query_ext, PROJ_ENVELOPE_POINTS); query::resolution_type res(m_.width()/query_ext.width(), m_.height()/query_ext.height()); - query q(layer_ext,res,scale_denom); + query q(layer_ext,res,scale_denom,unbuffered_extent); std::vector active_styles; attribute_collector collector(names);