2013-09-30 15:14:58 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* This file is part of Mapnik (c++ mapping toolkit)
|
|
|
|
*
|
2016-12-20 17:57:22 +01:00
|
|
|
* Copyright (C) 2016 Artem Pavlenko
|
2013-09-30 15:14:58 +02:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef TOPOJSON_FEATURESET_HPP
|
|
|
|
#define TOPOJSON_FEATURESET_HPP
|
|
|
|
|
|
|
|
#include <mapnik/feature.hpp>
|
|
|
|
#include "topojson_datasource.hpp"
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <deque>
|
|
|
|
|
|
|
|
class topojson_featureset : public mapnik::Featureset
|
|
|
|
{
|
|
|
|
public:
|
2014-08-19 23:48:21 +02:00
|
|
|
typedef std::deque<topojson_datasource::item_type> array_type;
|
2013-09-30 15:14:58 +02:00
|
|
|
topojson_featureset(mapnik::topojson::topology const& topo,
|
2013-10-03 18:12:33 +02:00
|
|
|
mapnik::transcoder const& tr,
|
2014-08-19 23:48:21 +02:00
|
|
|
array_type && index_array);
|
2013-10-23 16:01:29 +02:00
|
|
|
|
2013-09-30 15:14:58 +02:00
|
|
|
virtual ~topojson_featureset();
|
|
|
|
mapnik::feature_ptr next();
|
|
|
|
|
|
|
|
private:
|
2013-10-02 16:14:27 +02:00
|
|
|
mapnik::context_ptr ctx_;
|
2013-09-30 15:14:58 +02:00
|
|
|
mapnik::box2d<double> box_;
|
|
|
|
mapnik::topojson::topology const& topo_;
|
2013-10-03 18:12:33 +02:00
|
|
|
mapnik::transcoder const& tr_;
|
2014-08-19 23:48:21 +02:00
|
|
|
const array_type index_array_;
|
|
|
|
array_type::const_iterator index_itr_;
|
|
|
|
array_type::const_iterator index_end_;
|
2013-10-02 16:14:27 +02:00
|
|
|
std::size_t feature_id_;
|
2013-09-30 15:14:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TOPOJSON_FEATURESET_HPP
|