diff --git a/plugins/input/gdal/gdal_datasource.cpp b/plugins/input/gdal/gdal_datasource.cpp index 77356db53..c73ed8d2c 100644 --- a/plugins/input/gdal/gdal_datasource.cpp +++ b/plugins/input/gdal/gdal_datasource.cpp @@ -25,6 +25,7 @@ #include "gdal_featureset.hpp" // mapnik +#include #include #include @@ -199,6 +200,12 @@ gdal_datasource::~gdal_datasource() { } +mapnik::statistics_ptr gdal_datasource::get_statistics() const +{ + if (! is_bound_) bind(); + return boost::make_shared(stats_); +} + datasource::datasource_t gdal_datasource::type() const { return datasource::Raster; diff --git a/plugins/input/gdal/gdal_datasource.hpp b/plugins/input/gdal/gdal_datasource.hpp index 4aa841371..a37b8b642 100644 --- a/plugins/input/gdal/gdal_datasource.hpp +++ b/plugins/input/gdal/gdal_datasource.hpp @@ -44,6 +44,7 @@ public: mapnik::box2d envelope() const; boost::optional get_geometry_type() const; mapnik::layer_descriptor get_descriptor() const; + mapnik::statistics_ptr get_statistics() const; void bind() const; private: mutable mapnik::box2d extent_; @@ -56,6 +57,7 @@ private: mutable double dy_; mutable int nbands_; mutable bool shared_dataset_; + mutable std::map stats_; double filter_factor_; inline GDALDataset* open_dataset() const; }; diff --git a/plugins/input/ogr/ogr_datasource.cpp b/plugins/input/ogr/ogr_datasource.cpp index ccfce9a16..35ba9ace5 100644 --- a/plugins/input/ogr/ogr_datasource.cpp +++ b/plugins/input/ogr/ogr_datasource.cpp @@ -429,7 +429,7 @@ layer_descriptor ogr_datasource::get_descriptor() const return desc_; } -std::map ogr_datasource::get_statistics() const +mapnik::statistics_ptr ogr_datasource::get_statistics() const { if (! is_bound_) bind(); return boost::make_shared(stats_);