bool svg_renderer<OutputIterator>::process(rule::symbolizers const& syms, mapnik::feature_impl & feature, proj_transform const& prj_trans) { // svg renderer supports processing of multiple symbolizers. typedef coord_transform<CoordTransform, geometry_type> path_type; bool process_path = false; // process each symbolizer to collect its (path) information. // path information (attributes from line_ and polygon_ symbolizers) // is collected with the path_attributes_ data member. for (symbolizer const& sym : syms) { if (is_path_based(sym)) { process_path = true; } boost::apply_visitor(symbol_dispatch(*this, feature, prj_trans), sym); } if (process_path) { // generate path output for each geometry of the current feature. for(std::size_t i=0; i<feature.num_geometries(); ++i) { geometry_type & geom = feature.get_geometry(i); if(geom.size() > 0) { path_type path(t_, geom, prj_trans); generator_.generate_path(path, path_attributes_); } } // set the previously collected values back to their defaults // for the feature that will be processed next. path_attributes_.reset(); } return true; }
bool svg_renderer<OutputIterator>::process(rule::symbolizers const& syms, mapnik::feature_impl & feature, proj_transform const& prj_trans) { // svg renderer supports processing of multiple symbolizers. using path_type = transform_path_adapter<view_transform, geometry_type>; bool process_path = false; // process each symbolizer to collect its (path) information. // path information (attributes from line_ and polygon_ symbolizers) // is collected with the path_attributes_ data member. for (auto const& sym : syms) { if (is_path_based(sym)) { process_path = true; } util::apply_visitor(symbolizer_dispatch<svg_renderer<OutputIterator>>(*this, feature, prj_trans), sym); } if (process_path) { // generate path output for each geometry of the current feature. for (auto & geom : feature.paths()) { if(geom.size() > 0) { path_type path(common_.t_, geom, prj_trans); generate_path(generator_.output_iterator_, path, path_attributes_); } } // set the previously collected values back to their defaults // for the feature that will be processed next. path_attributes_.reset(); } return true; }