2012-07-19 20:06:44 +02:00
|
|
|
#ifndef PYTHON_FEATURESET_HPP
|
|
|
|
#define PYTHON_FEATURESET_HPP
|
|
|
|
|
2013-01-04 18:23:06 +01:00
|
|
|
// mapnik
|
2014-08-12 20:10:32 +02:00
|
|
|
#include <mapnik/config.hpp>
|
2013-01-04 18:23:06 +01:00
|
|
|
#include <mapnik/feature.hpp>
|
|
|
|
|
2012-07-19 20:06:44 +02:00
|
|
|
// boost
|
2014-10-22 01:37:27 +02:00
|
|
|
#pragma GCC diagnostic push
|
|
|
|
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
|
|
|
#pragma GCC diagnostic ignored "-Wunused-local-typedef"
|
|
|
|
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
2012-07-19 20:06:44 +02:00
|
|
|
#include <boost/python.hpp>
|
|
|
|
#include <boost/python/stl_iterator.hpp>
|
2014-10-22 01:37:27 +02:00
|
|
|
#pragma GCC diagnostic pop
|
2012-07-19 20:06:44 +02:00
|
|
|
|
|
|
|
// mapnik
|
|
|
|
#include <mapnik/datasource.hpp>
|
|
|
|
|
|
|
|
class python_featureset : public mapnik::Featureset
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// this constructor can have any arguments you need
|
|
|
|
python_featureset(boost::python::object iterator);
|
|
|
|
|
|
|
|
// desctructor
|
|
|
|
virtual ~python_featureset();
|
|
|
|
|
|
|
|
// mandatory: you must expose a next() method, called when rendering
|
|
|
|
mapnik::feature_ptr next();
|
|
|
|
|
|
|
|
private:
|
2014-07-07 19:23:15 +02:00
|
|
|
using feature_iter = boost::python::stl_input_iterator<mapnik::feature_ptr>;
|
2012-07-19 20:06:44 +02:00
|
|
|
|
|
|
|
feature_iter begin_, end_;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // PYTHON_FEATURESET_HPP
|