More fixes

This commit is contained in:
Tom MacWright 2012-02-06 16:48:51 -05:00
parent d12b4e322f
commit a2ab9b5588
3 changed files with 10 additions and 1 deletions

View file

@ -25,6 +25,7 @@
#include "gdal_featureset.hpp"
// mapnik
#include <boost/make_shared.hpp>
#include <mapnik/ptree_helpers.hpp>
#include <mapnik/geom_util.hpp>
@ -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;

View file

@ -44,6 +44,7 @@ public:
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_;
@ -56,6 +57,7 @@ private:
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;
};

View file

@ -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_);