remove RENDERING_STATS compile time option - refs #1956
This commit is contained in:
parent
512f06fa44
commit
6bbbe155fe
4 changed files with 6 additions and 112 deletions
|
@ -336,8 +336,6 @@ opts.AddVariables(
|
||||||
|
|
||||||
# Variables affecting rendering back-ends
|
# Variables affecting rendering back-ends
|
||||||
|
|
||||||
BoolVariable('RENDERING_STATS', 'Output rendering statistics during style processing', 'False'),
|
|
||||||
|
|
||||||
BoolVariable('SVG_RENDERER', 'build support for native svg renderer', 'False'),
|
BoolVariable('SVG_RENDERER', 'build support for native svg renderer', 'False'),
|
||||||
BoolVariable('CPP_TESTS', 'Compile the C++ tests', 'True'),
|
BoolVariable('CPP_TESTS', 'Compile the C++ tests', 'True'),
|
||||||
BoolVariable('BENCHMARK', 'Compile the C++ benchmark scripts', 'False'),
|
BoolVariable('BENCHMARK', 'Compile the C++ benchmark scripts', 'False'),
|
||||||
|
|
|
@ -85,8 +85,7 @@ private:
|
||||||
/*!
|
/*!
|
||||||
* \brief renders a featureset with the given styles.
|
* \brief renders a featureset with the given styles.
|
||||||
*/
|
*/
|
||||||
void render_style(layer const& lay,
|
void render_style(Processor & p,
|
||||||
Processor & p,
|
|
||||||
feature_type_style const* style,
|
feature_type_style const* style,
|
||||||
rule_cache const& rules,
|
rule_cache const& rules,
|
||||||
std::string const& style_name,
|
std::string const& style_name,
|
||||||
|
|
|
@ -56,12 +56,6 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
#if defined(RENDERING_STATS)
|
|
||||||
#include <mapnik/timer.hpp>
|
|
||||||
#include <iomanip>
|
|
||||||
#include <sstream>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mapnik
|
namespace mapnik
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -152,11 +146,6 @@ feature_style_processor<Processor>::feature_style_processor(Map const& m, double
|
||||||
template <typename Processor>
|
template <typename Processor>
|
||||||
void feature_style_processor<Processor>::apply(double scale_denom)
|
void feature_style_processor<Processor>::apply(double scale_denom)
|
||||||
{
|
{
|
||||||
#if defined(RENDERING_STATS)
|
|
||||||
std::clog << "\n//-- starting rendering timer...\n";
|
|
||||||
mapnik::progress_timer t(std::clog, "total map rendering");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Processor & p = static_cast<Processor&>(*this);
|
Processor & p = static_cast<Processor&>(*this);
|
||||||
p.start_map_processing(m_);
|
p.start_map_processing(m_);
|
||||||
|
|
||||||
|
@ -186,11 +175,6 @@ void feature_style_processor<Processor>::apply(double scale_denom)
|
||||||
|
|
||||||
p.end_map_processing(m_);
|
p.end_map_processing(m_);
|
||||||
|
|
||||||
#if defined(RENDERING_STATS)
|
|
||||||
t.stop();
|
|
||||||
std::clog << "//-- rendering timer stopped...\n\n";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Processor>
|
template <typename Processor>
|
||||||
|
@ -250,23 +234,9 @@ void feature_style_processor<Processor>::apply_to_layer(layer const& lay, Proces
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(RENDERING_STATS)
|
|
||||||
progress_timer layer_timer(std::clog, "rendering total for layer: '" + lay.name() + "'");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
projection proj1(lay.srs(),true);
|
projection proj1(lay.srs(),true);
|
||||||
proj_transform prj_trans(proj0,proj1);
|
proj_transform prj_trans(proj0,proj1);
|
||||||
|
|
||||||
#if defined(RENDERING_STATS)
|
|
||||||
if (! prj_trans.equal())
|
|
||||||
{
|
|
||||||
std::clog << "notice: reprojecting layer: '" << lay.name() << "' from/to:\n\t'"
|
|
||||||
<< lay.srs() << "'\n\t'"
|
|
||||||
<< m_.srs() << "'\n";
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
box2d<double> query_ext = extent; // unbuffered
|
box2d<double> query_ext = extent; // unbuffered
|
||||||
box2d<double> buffered_query_ext(query_ext); // buffered
|
box2d<double> buffered_query_ext(query_ext); // buffered
|
||||||
|
|
||||||
|
@ -344,9 +314,6 @@ void feature_style_processor<Processor>::apply_to_layer(layer const& lay, Proces
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if defined(RENDERING_STATS)
|
|
||||||
layer_timer.discard();
|
|
||||||
#endif
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -491,7 +458,7 @@ void feature_style_processor<Processor>::apply_to_layer(layer const& lay, Proces
|
||||||
int i = 0;
|
int i = 0;
|
||||||
BOOST_FOREACH (feature_type_style const* style, active_styles)
|
BOOST_FOREACH (feature_type_style const* style, active_styles)
|
||||||
{
|
{
|
||||||
render_style(lay, p, style, rule_caches[i], style_names[i],
|
render_style(p, style, rule_caches[i], style_names[i],
|
||||||
cache.features(q), prj_trans);
|
cache.features(q), prj_trans);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
@ -504,7 +471,7 @@ void feature_style_processor<Processor>::apply_to_layer(layer const& lay, Proces
|
||||||
int i = 0;
|
int i = 0;
|
||||||
BOOST_FOREACH (feature_type_style const* style, active_styles)
|
BOOST_FOREACH (feature_type_style const* style, active_styles)
|
||||||
{
|
{
|
||||||
render_style(lay, p, style, rule_caches[i], style_names[i],
|
render_style(p, style, rule_caches[i], style_names[i],
|
||||||
cache.features(q), prj_trans);
|
cache.features(q), prj_trans);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
@ -525,7 +492,7 @@ void feature_style_processor<Processor>::apply_to_layer(layer const& lay, Proces
|
||||||
int i = 0;
|
int i = 0;
|
||||||
BOOST_FOREACH (feature_type_style const* style, active_styles)
|
BOOST_FOREACH (feature_type_style const* style, active_styles)
|
||||||
{
|
{
|
||||||
render_style(lay, p, style, rule_caches[i], style_names[i],
|
render_style(p, style, rule_caches[i], style_names[i],
|
||||||
cache.features(q), prj_trans);
|
cache.features(q), prj_trans);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
@ -536,24 +503,18 @@ void feature_style_processor<Processor>::apply_to_layer(layer const& lay, Proces
|
||||||
int i = 0;
|
int i = 0;
|
||||||
BOOST_FOREACH (feature_type_style const* style, active_styles)
|
BOOST_FOREACH (feature_type_style const* style, active_styles)
|
||||||
{
|
{
|
||||||
render_style(lay, p, style, rule_caches[i], style_names[i],
|
render_style(p, style, rule_caches[i], style_names[i],
|
||||||
ds->features(q), prj_trans);
|
ds->features(q), prj_trans);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(RENDERING_STATS)
|
|
||||||
layer_timer.stop();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
p.end_layer_processing(lay);
|
p.end_layer_processing(lay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <typename Processor>
|
template <typename Processor>
|
||||||
void feature_style_processor<Processor>::render_style(
|
void feature_style_processor<Processor>::render_style(
|
||||||
layer const& lay,
|
|
||||||
Processor & p,
|
Processor & p,
|
||||||
feature_type_style const* style,
|
feature_type_style const* style,
|
||||||
rule_cache const& rc,
|
rule_cache const& rc,
|
||||||
|
@ -567,25 +528,9 @@ void feature_style_processor<Processor>::render_style(
|
||||||
p.end_style_processing(*style);
|
p.end_style_processing(*style);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(RENDERING_STATS)
|
|
||||||
std::ostringstream s1;
|
|
||||||
s1 << "rendering style for layer: '" << lay.name()
|
|
||||||
<< "' and style '" << style_name << "'";
|
|
||||||
mapnik::progress_timer style_timer(std::clog, s1.str());
|
|
||||||
|
|
||||||
int feature_processed_count = 0;
|
|
||||||
int feature_count = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
feature_ptr feature;
|
feature_ptr feature;
|
||||||
while ((feature = features->next()))
|
while ((feature = features->next()))
|
||||||
{
|
{
|
||||||
#if defined(RENDERING_STATS)
|
|
||||||
feature_count++;
|
|
||||||
bool feat_processed = false;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool do_else = true;
|
bool do_else = true;
|
||||||
bool do_also = false;
|
bool do_also = false;
|
||||||
|
|
||||||
|
@ -595,10 +540,6 @@ void feature_style_processor<Processor>::render_style(
|
||||||
value_type result = boost::apply_visitor(evaluate<feature_impl,value_type>(*feature),*expr);
|
value_type result = boost::apply_visitor(evaluate<feature_impl,value_type>(*feature),*expr);
|
||||||
if (result.to_bool())
|
if (result.to_bool())
|
||||||
{
|
{
|
||||||
#if defined(RENDERING_STATS)
|
|
||||||
feat_processed = true;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
p.painted(true);
|
p.painted(true);
|
||||||
|
|
||||||
do_else=false;
|
do_else=false;
|
||||||
|
@ -627,10 +568,6 @@ void feature_style_processor<Processor>::render_style(
|
||||||
{
|
{
|
||||||
BOOST_FOREACH( rule const* r, rc.get_else_rules() )
|
BOOST_FOREACH( rule const* r, rc.get_else_rules() )
|
||||||
{
|
{
|
||||||
#if defined(RENDERING_STATS)
|
|
||||||
feat_processed = true;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
p.painted(true);
|
p.painted(true);
|
||||||
|
|
||||||
rule::symbolizers const& symbols = r->get_symbolizers();
|
rule::symbolizers const& symbols = r->get_symbolizers();
|
||||||
|
@ -649,10 +586,6 @@ void feature_style_processor<Processor>::render_style(
|
||||||
{
|
{
|
||||||
BOOST_FOREACH( rule const* r, rc.get_also_rules() )
|
BOOST_FOREACH( rule const* r, rc.get_also_rules() )
|
||||||
{
|
{
|
||||||
#if defined(RENDERING_STATS)
|
|
||||||
feat_processed = true;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
p.painted(true);
|
p.painted(true);
|
||||||
|
|
||||||
rule::symbolizers const& symbols = r->get_symbolizers();
|
rule::symbolizers const& symbols = r->get_symbolizers();
|
||||||
|
@ -667,32 +600,7 @@ void feature_style_processor<Processor>::render_style(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if defined(RENDERING_STATS)
|
|
||||||
if (feat_processed)
|
|
||||||
feature_processed_count++;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(RENDERING_STATS)
|
|
||||||
style_timer.stop();
|
|
||||||
|
|
||||||
// done with style
|
|
||||||
std::ostringstream s;
|
|
||||||
if (feature_count > 0)
|
|
||||||
{
|
|
||||||
double perc_processed = ((double)feature_processed_count/(double)feature_count)*100.0;
|
|
||||||
|
|
||||||
s << "percent rendered: " << perc_processed << "% - " << feature_processed_count
|
|
||||||
<< " rendered for " << feature_count << " queried for ";
|
|
||||||
s << std::setw(15 - (int)s.tellp()) << " layer '" << lay.name() << "' and style '" << style_name << "'\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
s << "" << std::setw(15) << "- no features returned from query for layer '" << lay.name() << "' and style '" << style_name << "'\n";
|
|
||||||
}
|
|
||||||
std::clog << s.str();
|
|
||||||
style_timer.discard();
|
|
||||||
#endif
|
|
||||||
p.end_style_processing(*style);
|
p.end_style_processing(*style);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
13
src/build.py
13
src/build.py
|
@ -145,6 +145,7 @@ source = Split(
|
||||||
transform_expression_grammar.cpp
|
transform_expression_grammar.cpp
|
||||||
transform_expression.cpp
|
transform_expression.cpp
|
||||||
feature_kv_iterator.cpp
|
feature_kv_iterator.cpp
|
||||||
|
feature_style_processor.cpp
|
||||||
feature_type_style.cpp
|
feature_type_style.cpp
|
||||||
font_engine_freetype.cpp
|
font_engine_freetype.cpp
|
||||||
font_set.cpp
|
font_set.cpp
|
||||||
|
@ -367,18 +368,6 @@ else:
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
processor_cpp = 'feature_style_processor.cpp'
|
|
||||||
|
|
||||||
if env['RENDERING_STATS']:
|
|
||||||
env3 = lib_env.Clone()
|
|
||||||
env3.Append(CPPDEFINES='-DRENDERING_STATS')
|
|
||||||
if env['LINKING'] == 'static':
|
|
||||||
source.insert(0,env3.StaticObject(processor_cpp))
|
|
||||||
else:
|
|
||||||
source.insert(0,env3.SharedObject(processor_cpp))
|
|
||||||
else:
|
|
||||||
source.insert(0,processor_cpp);
|
|
||||||
|
|
||||||
# clone the env one more time to isolate mapnik_lib_link_flag
|
# clone the env one more time to isolate mapnik_lib_link_flag
|
||||||
lib_env_final = lib_env.Clone()
|
lib_env_final = lib_env.Clone()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue