geojson.input - assign incremental feature_id in geojson_index_featureset and geojson_memory_index_featureset
(ref #3134)
This commit is contained in:
parent
d9a66a765c
commit
c053682711
4 changed files with 4 additions and 3 deletions
|
@ -93,7 +93,7 @@ mapnik::feature_ptr geojson_index_featureset::next()
|
|||
static const mapnik::json::feature_grammar<char const*, mapnik::feature_impl> grammar(tr);
|
||||
using namespace boost::spirit;
|
||||
standard::space_type space;
|
||||
mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx_,1));
|
||||
mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx_, feature_id_++));
|
||||
if (!qi::phrase_parse(start, end, (grammar)(boost::phoenix::ref(*feature)), space) || start != end)
|
||||
{
|
||||
throw std::runtime_error("Failed to parse geojson feature");
|
||||
|
|
|
@ -56,6 +56,7 @@ private:
|
|||
using file_ptr = std::unique_ptr<std::FILE, int (*)(std::FILE *)>;
|
||||
file_ptr file_;
|
||||
#endif
|
||||
std::size_t feature_id_ = 1;
|
||||
mapnik::context_ptr ctx_;
|
||||
std::vector<value_type> positions_;
|
||||
std::vector<value_type>::iterator itr_;
|
||||
|
|
|
@ -69,7 +69,7 @@ mapnik::feature_ptr geojson_memory_index_featureset::next()
|
|||
static const mapnik::json::feature_grammar<chr_iterator_type,mapnik::feature_impl> grammar(tr);
|
||||
using namespace boost::spirit;
|
||||
standard::space_type space;
|
||||
mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx_,1));
|
||||
mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx_, feature_id_++));
|
||||
if (!qi::phrase_parse(start, end, (grammar)(boost::phoenix::ref(*feature)), space) || start != end)
|
||||
{
|
||||
throw std::runtime_error("Failed to parse geojson feature");
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
|
||||
private:
|
||||
file_ptr file_;
|
||||
|
||||
std::size_t feature_id_ = 1;
|
||||
const array_type index_array_;
|
||||
array_type::const_iterator index_itr_;
|
||||
array_type::const_iterator index_end_;
|
||||
|
|
Loading…
Reference in a new issue