topojson plugin : fix spatial index population, rename 'count' to 'index'
This commit is contained in:
parent
3c99514c85
commit
2d50a2dccc
1 changed files with 4 additions and 3 deletions
|
@ -208,7 +208,7 @@ void topojson_datasource::parse_topojson(T & stream)
|
|||
throw mapnik::datasource_exception("topojson_datasource: Failed parse TopoJSON file '" + filename_ + "'");
|
||||
}
|
||||
|
||||
std::size_t count = 0;
|
||||
std::size_t index = 0;
|
||||
for (auto const& geom : topo_.geometries)
|
||||
{
|
||||
mapnik::box2d<double> box = mapnik::util::apply_visitor(mapnik::topojson::bounding_box_visitor(topo_), geom);
|
||||
|
@ -225,11 +225,12 @@ void topojson_datasource::parse_topojson(T & stream)
|
|||
extent_.expand_to_include(box);
|
||||
}
|
||||
#if BOOST_VERSION >= 105600
|
||||
tree_.insert(std::make_pair(box_type(point_type(box.minx(),box.miny()),point_type(box.maxx(),box.maxy())),count++));
|
||||
tree_.insert(std::make_pair(box_type(point_type(box.minx(),box.miny()),point_type(box.maxx(),box.maxy())),index));
|
||||
#else
|
||||
tree_.insert(box_type(point_type(box.minx(),box.miny()),point_type(box.maxx(),box.maxy())),count++);
|
||||
tree_.insert(box_type(point_type(box.minx(),box.miny()),point_type(box.maxx(),box.maxy())),index);
|
||||
#endif
|
||||
}
|
||||
++index;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue