Hi,
NopMap wrote:
>> Could you share this tool with us please, e.g. upload it to OSM's SVN?
> That is not possible as it makes use of the internal features of Composer.
> It crossreferences the rendering rules with the usage statistics, very much
> like the wizard does, just without a GUI. I fear it is utterly meaningless
> to everybody who is not building his rendering rules with Composer.
Tobias, you could still use my tool I mentioned a few posts ago to
determine the select statements issued per zoom level.
Also, I have a patch for Mapnik that counts exactly how many features
are returned by each processing step and how many of them are actually
rendered, giving you exact figures of "waste" for real-world rendering.
The patch is against 0.6.1 and I always wanted to clean it up and submit
it against trunk but haven't found the time yet, so maybe the attached
is of use.
(I don't know if this is a modern design feature, I always find myself
cursing the fact that so much goes on in header files in Mapnik which
means that rather than "recompile Mapnik with -DEBUG, install" I always
have to "recompile Mapnik with -DEBUG, install dev package, build
renderd, install"... just keep in mind that the changes below require
recompiling the software that uses Mapnik, and not necessarily Mapnik
itself.)
Bye
Frederik
--- include/mapnik/feature_style_processor.hpp (revision 1336)
+++ include/mapnik/feature_style_processor.hpp (working copy)
@@ -193,6 +208,11 @@
if (fs)
{
feature_ptr feature;
+#ifdef MAPNIK_DEBUG
+ int used_count = 0;
+ int not_used_count = 0;
+ bool used = false;
+#endif
while ((feature = fs->next()))
{
bool do_else=true;
@@ -204,6 +224,9 @@
if (filter->pass(*feature))
{
do_else=false;
+#ifdef MAPNIK_DEBUG
+ used = true;
+#endif
const symbolizers& symbols =
(*itr)->get_symbolizers();
symbolizers::const_iterator
symIter=symbols.begin();
symbolizers::const_iterator symEnd
=symbols.end();
@@ -223,6 +246,9 @@
else_rules.end();
for (;itr != end;++itr)
{
+#ifdef MAPNIK_DEBUG
+ used = true;
+#endif
const symbolizers& symbols =
(*itr)->get_symbolizers();
symbolizers::const_iterator symIter=
symbols.begin();
symbolizers::const_iterator symEnd =
symbols.end();
@@ -234,7 +260,16 @@
}
}
}
+#ifdef MAPNIK_DEBUG
+ if (used) used_count++; else not_used_count++;
+#endif
}
+
+#ifdef MAPNIK_DEBUG
+ int sum = used_count + not_used_count;
+ int percent = (sum==0) ? 0 : used_count * 100 /
sum;
+ std::clog << "STAT: style '"<< *stylesIter <<
"': " << std::dec << used_count << "/" << std::dec << sum << " features
rendered (" << std::dec << percent << "%) from layer '" << lay.name() <<
"'" << std::endl;
+#endif
}
}
}
--
Frederik Ramm ## eMail [email protected] ## N49°00'09" E008°23'33"
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users