Skip to content

Commit

Permalink
Merge branch 'statistics' into statistics-tilemill
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcw committed Feb 6, 2012
2 parents d031452 + a2ab9b5 commit ad293b4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions plugins/input/gdal/gdal_datasource.cpp
Expand Up @@ -25,6 +25,7 @@
#include "gdal_featureset.hpp"

// mapnik
#include <boost/make_shared.hpp>
#include <mapnik/ptree_helpers.hpp>
#include <mapnik/geom_util.hpp>

Expand Down Expand Up @@ -199,6 +200,12 @@ gdal_datasource::~gdal_datasource()
{
}

mapnik::statistics_ptr gdal_datasource::get_statistics() const
{
if (! is_bound_) bind();
return boost::make_shared<mapnik::statistics>(stats_);
}

datasource::datasource_t gdal_datasource::type() const
{
return datasource::Raster;
Expand Down
2 changes: 2 additions & 0 deletions plugins/input/gdal/gdal_datasource.hpp
Expand Up @@ -44,6 +44,7 @@ class gdal_datasource : public mapnik::datasource
mapnik::box2d<double> envelope() const;
boost::optional<mapnik::datasource::geometry_t> get_geometry_type() const;
mapnik::layer_descriptor get_descriptor() const;
mapnik::statistics_ptr get_statistics() const;
void bind() const;
private:
mutable mapnik::box2d<double> extent_;
Expand All @@ -56,6 +57,7 @@ class gdal_datasource : public mapnik::datasource
mutable double dy_;
mutable int nbands_;
mutable bool shared_dataset_;
mutable std::map<std::string, mapnik::parameters> stats_;
double filter_factor_;
inline GDALDataset* open_dataset() const;
};
Expand Down
2 changes: 1 addition & 1 deletion plugins/input/ogr/ogr_datasource.cpp
Expand Up @@ -429,7 +429,7 @@ layer_descriptor ogr_datasource::get_descriptor() const
return desc_;
}

std::map<std::string, mapnik::parameters> ogr_datasource::get_statistics() const
mapnik::statistics_ptr ogr_datasource::get_statistics() const
{
if (! is_bound_) bind();
return boost::make_shared<mapnik::statistics>(stats_);
Expand Down

0 comments on commit ad293b4

Please sign in to comment.