use expression_factory::parse_from_string not parse_expression in text formatting load_xml #1168

springmeyer opened this Issue Apr 6, 2012 · 5 comments


None yet
3 participants

springmeyer commented Apr 6, 2012

No description provided.


springmeyer commented Apr 6, 2012

@herm - was this in your plans? Were re-using the grammars in the fast_cast stuff but it appears we're not yet re-using grammers in the text formatting/placement from_xml parsing. Am I seeing that right?


artemp commented Jul 3, 2012

@herm did you have a chance to look into this ?


springmeyer commented Jul 3, 2012

It looks to me that being able to pass the grammar through is going to require some serious cleanup and refactoring of the new text formatting/placement stuff. @herm - can you comment on how you see this working?


artemp commented Jul 4, 2012

@herm @springmeyer

this line :

return boost::make_shared<text_node>(parse_expression(data, "utf8"));

expands to :

transcoder tr("utf8");
mapnik::expression_grammar<std::string::const_iterator> grammar(tr);
expression_ptr expr(boost::make_shared<expr_node>(false));
expression_factory::parse_from_string(expr, data, grammar);
return boost::make_shared<text_node>(expr);

which is expensive.

@herm herm added a commit that referenced this issue Jul 4, 2012

@herm herm Reuse expression grammar for TextSymbolizer.
Refs #1168.

herm closed this in 82d7a63 Jul 4, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment