diff --git a/src/memory_datasource.cpp b/src/memory_datasource.cpp index fdf2c1969..8de1b9491 100644 --- a/src/memory_datasource.cpp +++ b/src/memory_datasource.cpp @@ -26,6 +26,7 @@ #include #include #include +#include // stl #include @@ -112,6 +113,24 @@ layer_descriptor memory_datasource::get_descriptor() const std::map memory_datasource::get_statistics() const { std::map _stats; + + // Temporary storage for full values + std::map > _values; + + mapnik::query q(envelope()); + mapnik::featureset_ptr fs; + mapnik::feature_ptr fp; + fs = features(q); + + while(fp = fs->next()) { + std::map const& fprops = fp->props(); + std::map::const_iterator it = fprops.begin(); + std::map::const_iterator end = fprops.end(); + for (; it != end; ++it) { + _values[it->first].push_back(it->second.to_double()); + } + } + return _stats; }