GeoJSON - ensure descriptors order is consistent ( ref #3494)

This commit is contained in:
artemp 2016-08-15 12:21:02 +01:00
parent 0471f3369a
commit 046c9638e1

View file

@ -233,7 +233,6 @@ void geojson_datasource::initialise_disk_index(std::string const& filename)
mapnik::util::file file(filename_); mapnik::util::file file(filename_);
if (!file) throw mapnik::datasource_exception("GeoJSON Plugin: could not open: '" + filename_ + "'"); if (!file) throw mapnik::datasource_exception("GeoJSON Plugin: could not open: '" + filename_ + "'");
for (auto const& pos : positions) for (auto const& pos : positions)
{ {
std::fseek(file.get(), pos.first, SEEK_SET); std::fseek(file.get(), pos.first, SEEK_SET);
@ -243,7 +242,7 @@ void geojson_datasource::initialise_disk_index(std::string const& filename)
auto const* start = record.data(); auto const* start = record.data();
auto const* end = start + record.size(); auto const* end = start + record.size();
mapnik::context_ptr ctx = std::make_shared<mapnik::context_type>(); mapnik::context_ptr ctx = std::make_shared<mapnik::context_type>();
mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx,1)); mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx, -1));
using namespace boost::spirit; using namespace boost::spirit;
standard::space_type space; standard::space_type space;
if (!boost::spirit::qi::phrase_parse(start, end, if (!boost::spirit::qi::phrase_parse(start, end,
@ -254,6 +253,7 @@ void geojson_datasource::initialise_disk_index(std::string const& filename)
} }
initialise_descriptor(feature); initialise_descriptor(feature);
} }
desc_.order_by_name();
} }
template <typename Iterator> template <typename Iterator>
@ -339,6 +339,7 @@ void geojson_datasource::initialise_index(Iterator start, Iterator end)
} }
} }
} }
desc_.order_by_name();
} }
template <typename Iterator> template <typename Iterator>