backport geojson plugin fixes from master - refs #2319 and 2367
This commit is contained in:
parent
36bd809361
commit
ef6cabfa8a
2 changed files with 6 additions and 7 deletions
|
@ -140,15 +140,13 @@ geojson_datasource::geojson_datasource(parameters const& params)
|
|||
throw mapnik::datasource_exception("geojson_datasource: Failed parse GeoJSON file '" + file_ + "'");
|
||||
}
|
||||
|
||||
bool first = true;
|
||||
std::size_t count = 0;
|
||||
std::size_t geometry_index = 0;
|
||||
BOOST_FOREACH (mapnik::feature_ptr const& f, features_)
|
||||
{
|
||||
mapnik::box2d<double> box = f->envelope();
|
||||
if (first)
|
||||
if (geometry_index == 0)
|
||||
{
|
||||
extent_ = box;
|
||||
first = false;
|
||||
mapnik::feature_kv_iterator f_itr = f->begin();
|
||||
mapnik::feature_kv_iterator f_end = f->end();
|
||||
for ( ;f_itr!=f_end; ++f_itr)
|
||||
|
@ -162,10 +160,11 @@ geojson_datasource::geojson_datasource(parameters const& params)
|
|||
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())),geometry_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())),geometry_index);
|
||||
#endif
|
||||
++geometry_index;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ mapnik::feature_ptr geojson_featureset::next()
|
|||
geojson_datasource::item_type const& item = *index_itr_++;
|
||||
std::size_t index = item.second;
|
||||
#else
|
||||
std::size_t const& index = *index_itr_++;
|
||||
std::size_t index = *index_itr_++;
|
||||
#endif
|
||||
if ( index < features_.size())
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue