diff --git a/include/mapnik/attribute_collector.hpp b/include/mapnik/attribute_collector.hpp index 70e1a5e8d..e256a6c9e 100644 --- a/include/mapnik/attribute_collector.hpp +++ b/include/mapnik/attribute_collector.hpp @@ -213,12 +213,12 @@ struct symbolizer_attributes : public boost::static_visitor<> void operator () (building_symbolizer const& sym) { - expression_ptr const& height_expr = sym.height(); - if (height_expr) - { - expression_attributes f_attr(names_); - boost::apply_visitor(f_attr,*height_expr); - } + expression_ptr const& height_expr = sym.height(); + if (height_expr) + { + expression_attributes f_attr(names_); + boost::apply_visitor(f_attr,*height_expr); + } collect_metawriter(sym); } // TODO - support remaining syms diff --git a/src/agg/process_building_symbolizer.cpp b/src/agg/process_building_symbolizer.cpp index 4546b0d7d..0a5b573a7 100644 --- a/src/agg/process_building_symbolizer.cpp +++ b/src/agg/process_building_symbolizer.cpp @@ -71,8 +71,8 @@ void agg_renderer::process(building_symbolizer const& sym, expression_ptr height_expr = sym.height(); if (height_expr) { - value_type result = boost::apply_visitor(evaluate(feature), *height_expr); - height = result.to_double() * scale_factor_; + value_type result = boost::apply_visitor(evaluate(feature), *height_expr); + height = result.to_double() * scale_factor_; } for (unsigned i=0;i(feature), *height_expr); - height = 0.7071 * result.to_double(); - } + expression_ptr height_expr = sym.height(); + if (height_expr) + { + value_type result = boost::apply_visitor(evaluate(feature), *height_expr); + height = 0.7071 * result.to_double(); + } for (unsigned i = 0; i < feature.num_geometries(); ++i) { diff --git a/src/save_map.cpp b/src/save_map.cpp index 63edbfce8..63f1b84ff 100644 --- a/src/save_map.cpp +++ b/src/save_map.cpp @@ -241,10 +241,9 @@ public: { set_attr( sym_node, "fill-opacity", sym.get_opacity() ); } - if ( sym.height() != dfl.height() || explicit_defaults_ ) - { - set_attr( sym_node, "height", sym.height() ); - } + + set_attr( sym_node, "height", to_expression_string(*sym.height()) ); + add_metawriter_attributes(sym_node, sym); }