Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

+ support attribute collection policy accross renderer backends

  • Loading branch information...
commit 7ded35ef94a792ff2313e2087a5684c938fc1497 1 parent dd32714
@artemp artemp authored
View
4 include/mapnik/agg_renderer.hpp
@@ -119,6 +119,10 @@ class MAPNIK_DECL agg_renderer : public feature_style_processor<agg_renderer<T>
};
void painted(bool painted);
+ inline eAttributeCollectionPolicy attribute_collection_policy() const
+ {
+ return DEFAULT;
+ }
protected:
template <typename R>
View
5 include/mapnik/cairo_renderer.hpp
@@ -123,6 +123,11 @@ class MAPNIK_DECL cairo_renderer_base : private boost::noncopyable
// nothing to do
}
+ inline eAttributeCollectionPolicy attribute_collection_policy() const
+ {
+ return DEFAULT;
+ }
+
void render_marker(pixel_position const& pos, marker const& marker, const agg::trans_affine & mtx, double opacity=1.0, bool recenter=true);
void render_box(box2d<double> const& b);
protected:
View
23 include/mapnik/feature_style_processor_impl.hpp
@@ -382,10 +382,20 @@ void feature_style_processor<Processor>::apply_to_layer(layer const& lay, Proces
// Don't even try to do more work if there are no active styles.
if (active_styles.size() > 0)
{
- // push all property names
- BOOST_FOREACH(std::string const& name, names)
+ if (p.attribute_collection_policy() == COLLECT_ALL)
{
- q.add_property_name(name);
+ layer_descriptor lay_desc = ds->get_descriptor();
+ BOOST_FOREACH(attribute_descriptor const& desc, lay_desc.get_descriptors())
+ {
+ q.add_property_name(desc.get_name());
+ }
+ }
+ else
+ {
+ BOOST_FOREACH(std::string const& name, names)
+ {
+ q.add_property_name(name);
+ }
}
// Update filter_factor for all enabled raster layers.
@@ -397,14 +407,11 @@ void feature_style_processor<Processor>::apply_to_layer(layer const& lay, Proces
ds->type() == datasource::Raster &&
ds->params().get<double>("filter_factor",0.0) == 0.0)
{
- rule::symbolizers const& symbols = r.get_symbolizers();
- rule::symbolizers::const_iterator symIter = symbols.begin();
- rule::symbolizers::const_iterator symEnd = symbols.end();
- while (symIter != symEnd)
+ BOOST_FOREACH (rule::symbolizers::value_type sym, r.get_symbolizers())
{
// if multiple raster symbolizers, last will be respected
// should we warn or throw?
- boost::apply_visitor(d_collector,*symIter++);
+ boost::apply_visitor(d_collector,sym);
}
q.set_filter_factor(filt_factor);
}
View
4 include/mapnik/grid/grid_renderer.hpp
@@ -109,6 +109,10 @@ class MAPNIK_DECL grid_renderer : public feature_style_processor<grid_renderer<T
{
pixmap_.painted(painted);
}
+ inline eAttributeCollectionPolicy attribute_collection_policy() const
+ {
+ return DEFAULT;
+ }
private:
buffer_type & pixmap_;
Please sign in to comment.
Something went wrong with that request. Please try again.